--- "Fahri Reza" <firehaz...@...> wrote: > for a quicky solution instead of WM_VSCROLL, > I would go with WM_ERASEBKGND, > > procedure TMyTree.TreeWndProc(var Message: TMessage); > var > r :TRect; > begin > if( Message.Msg = WM_ERASEBKGND )then > begin > r := bt.ClientRect; > r.Right := r.Right +1; > r.Bottom := r.Bottom +1; > InvalidateRect( Handle,@r,FALSE ); > end; > OldWndProc(Message); > end; > > I'm guessing that +1 is GetSystemMetrics( SM_CXBORDER )
I tried your code, but the buttons disappear when the TreeView scroll. (Maybe I'm not doing correctly). So far I have achieved acceptable results with this code procedure TMyTree.TreeWndProc(var Message: TMessage); begin OldWndProc(Message); if (Message.Msg = WM_VSCROLL) or (Message.Msg = WM_KEYDOWN) or (Message.Msg = WM_KEYUP) then begin Self.Invalidate ; end ; end; However, this blik a little :-( Thanks for All. Neo.