Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > VCL

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2017, 08:20 AM
lexd lexd is offline
Senior Member
 
Join Date: Feb 2015
Posts: 260
Default A ToolButton update

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.
Reply With Quote
  #2  
Old 09-25-2017, 01:48 AM
lexd lexd is offline
Senior Member
 
Join Date: Feb 2015
Posts: 260
Default

I found it easier to change the size of the spacers
Reply With Quote
  #3  
Old 10-03-2017, 03:50 AM
lexd lexd is offline
Senior Member
 
Join Date: Feb 2015
Posts: 260
Default

Attached is a ToolBar descendant that rearranges the buttons when one of the buttons change visibility. Written in Delphi 7
Attached Files
File Type: zip MovBar 1.0.zip (2.3 KB, 7 views)
Reply With Quote
Reply

Tags
delphi 7

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:06 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.