Du bist hier: Snippet-Verzeichnis » Delphi (11)
Sprache:

eingelassene Buttons erstellen

Sprache: Deutsch
Programmiersprache: Delphi
Veröffentlicht von: pumi
Letzte Änderung: 16.05.2006
Aufrufe: 1280


Beschreibung

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;

Noch kein Kommentar vorhanden

Dieses Snippet kommentieren

Name *  

E-Mail (wird nicht angezeigt) *    

Website  

Kommentar *  

Sicherheitscode Sicherheitscode *    

RSS