|
Napisał Administrator
|
|
wtorek, 24 styczeń 2006 |
Flat button
Private Declare Function GetWindowLong& Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long)
Private Declare Function SetWindowLong& Lib "user32" Alias
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal
dwNewLong As Long)
Const BS_FLAT = &H8000&
Const GWL_STYLE = (-16)
Public Sub Flat_Button(Frm As Form)
Dim InitBTStyle As Long
For I = 0 To (Frm.Controls.Count - 1)
Set ctrlTarget = Frm.Controls(I)
If TypeOf ctrlTarget Is CommandButton Then
InitBTStyle = GetWindowLong&(ctrlTarget.hwnd, GWL_STYLE)
SetWindowLong ctrlTarget.hwnd, GWL_STYLE, InitBTStyle Or BS_FLAT
ctrlTarget.Refresh
End If
Next I
End Sub
Teraz wystarczy tylko:
Flat_Button Me
Tips dostarczył: marins
Aby dodać komentarz zaloguj się. Jeśli nie masz konta, załóż je sobie. Tylko zarejestrowani użytkownicy mogą pisać komentarze. Powered by AkoComment 2.0! |