![]() |
#1
|
|||
|
|||
![]()
My Delphi 7 ToolButton does not like being made not visible/visible
I picked up on the net the parent TToolBar.RecreateWND paints the button back in. I started writing the below code and Delphi locks up, I expect on RecreateWND. Why? unit VisToolButton; interface uses Windows, QComCtrls; type TVisToolButton = class(TToolButton) private function GetVisible: boolean; procedure SetVisible(const Value: boolean); Published property Visible: boolean read GetVisible write SetVisible; end; implementation { TVisToolButton } function TVisToolButton.GetVisible: boolean; begin Inherited.Visible; end; procedure TVisToolButton.SetVisible(const Value: boolean); begin Inherited.Visible := Value; If Parent is TToolBar then Parent(TToolBar).RecreateWND; end; end. |
#2
|
|||
|
|||
![]()
I found it easier to change the size of the spacers
|
#3
|
|||
|
|||
![]()
Attached is a ToolBar descendant that rearranges the buttons when one of the buttons change visibility. Written in Delphi 7
|
![]() |
Tags |
delphi 7 |
Thread Tools | |
Display Modes | |
|
|