Topic: How to change button style
I need to change the button style using Script from bsPushButton to bsCommandLink need your help with the following code.
var myButton : TBitBtn;
var myImage: TPNGImage;
begin
myButton := TBitBtn.Create(Form1);
myImage := TPNGImage.Create;
try
myButton.Parent := Form1;
myButton.Left := 5;
myButton.Top := 5;
myButton.Width := 35;
myButton.height := 35;
myButton.Hint:='Folder';
myButton.ShowHint:= True;
myButton.Style:= 0; {<---- need to change to bsCommandLink }
myImage.LoadFromFile('Images\folder.png');
myButton.Glyph.Width := 30;
myButton.Glyph.height := 30;
myButton.Layout := blGlyphTop;
myButton.Margin := 0;
myButton.Spacing := 0;
myButton.Glyph.Canvas.Draw(0,0,myImage);
finally
myImage.Free;
end;
end.