Your original code showed TButton.parent := self, not Treeview.

   so let me get this straight: you want the button to scroll out of sight when 
you scroll down on the treeview, or to stay in view? If you want it to stay in 
view then it's going to be an independent button from the treeview, like if 
it's on a toolbar above the treeview. That doesn't sound too practical to have 
it scroll out of sight, so I don't think I understand what you're looking for.

Dave

--- On Tue, 1/6/09, neomavez <neoma...@hotmail.com> wrote:
From: neomavez <neoma...@hotmail.com>
Subject: [advanced_delphi] Re: Subcomponent of TWincontrol scroll too...
To: advanced_delphi@yahoogroups.com
Date: Tuesday, January 6, 2009, 5:43 AM










    
            Charlie and David, Thanks for answering. I think I do not give a 
good

explanation of the problem. Sorry for my english.

I want a descendant of TTreeView that have a button within itself (in

its display area). 

In my first message I said "When TTReeView Scroll, the button Scroll

too". Its not exactly true. The button seems to scroll, but if I call

Repaint, the button is still there, equidistant from the top edge.

How can I make the button does not move from there And it does not

"blink"? There is a message that I can capture to repaint Button? Any

other idea?



All of this explanation is about the code that I put in my first message: 

Button.Parent := TreeView 



Thanks very much



--- David Smith <djsmith_1998@ ...> wrote:

>

> What happens when you make the buttons parent the Treeview?

>  

> Dave

> 

> --- On Mon, 1/5/09, Charlie Chambers <chambers120@ ...> wrote:

> 

> From: Charlie Chambers <chambers120@ ...>

> Subject: Re: [advanced_delphi] Subcomponent of 

> TWincontrol scroll too...

> To: advanced_delphi@ yahoogroups. com

> Date: Monday, January 5, 2009, 10:01 AM

> 

> 

> 

> Have a look at the anchors property on the TButton

>  

> Cheers,

> Charlie

>  

> 

> ----- Original Message ----- 

> From: neomavez 

> To: advanced_delphi@ yahoogroups. com 

> Sent: Monday, January 05, 2009 11:50 AM

> Subject: [advanced_delphi] Subcomponent of TWincontrol scroll too...

> 

> 

> I need to make a component that descends from TTreeView. I 

> want to add a button as subcomponent.

> 

> constructor TMyTree.Create( AOwner: TComponent);

> begin

> inherited;

> 

> bt := TButton.Create( Self) ;

> bt.Parent := Self ;

> btAll.SetSubCompone nt(True) ;

> 

> btAll.Height := x ;

> etc, etc etc

> 

> end;

> 

> Everything works perfect, but when TTReeView Scroll, 

> the button Scroll

> too. I would like to remain equidistant from the top edge.

> How should I deal with this problem? The Button Parent should 

> be the same Parent of "Self" (i.e. the Form) ?

> I would thank you very much for a little clue to continue. 

> I hope you understand my english.

> 

> TIA

>




      

    
    
        
         
        
        








        


        
        


      

Reply via email to