You're here: Snippet Directory » Delphi (11)
Language:

eingelassene Buttons erstellen

Language: Deutsch
Programming Language: Delphi
Published by: pumi
Last Update: 5/16/2006
Views: 1211


Description

Mit folgender Prozedur lässt sich das Aussehen eines Buttons ändern., per Win-API

Code

1 Type 2 TButtonStyle=(Static, Sunken, Normal); 3 //ändert das Aussehen eines Buttons 4 //aButton ist der Name des Buttons 5 //Style= Static,Sunken oder Normal 6 procedure BorderButton(aButton: TButton;Style: TButtonStyle); 7 . 8 . 9 . 10 procedure BorderButton(aButton: TButton;Style: TButtonStyle); 11 var bx, by, bheight, bwidth: integer; 12 begin 13 case Style of 14 Static: SetWindowLong(aButton.Handle, GWL_EXSTYLE, WS_EX_STATICEDGE); 15 Sunken: SetWindowLong(aButton.Handle, GWL_EXSTYLE, WS_EX_CLIENTEDGE); 16 Normal: SetWindowLong(aButton.Handle, GWL_EXSTYLE, WS_EX_WINDOWEDGE); 17 end; 18 bx := aButton.Left; 19 by := aButton.Top; 20 bwidth := aButton.Width; 21 bheight := aButton.Height; 22 SetWindowPos(aButton.Handle, HWND_TOP, bx, by, bwidth, bheight, 23 SWP_FRAMECHANGED); 24 end;

No comments avaiable

Add a comment

Name *  

Email (won't be displayed) *    

Website  

Comment *  

Sicherheitscode Security Code *    

RSS