Zm∞na stylu CheckBoxu nebo OptionButtonu

Procedura:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _ 
(ByVal hWnd As Long, ByVal nIndex As Long) As Long 
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _ 
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal newValue As Long) As Long 
Private Const GWL_STYLE = (-16) 
Private Const BS_PUSHLIKE = &H1000& 

Sub SetButtonStyle(Ctrl As Control, ByVal Graphical As Boolean) 

   If Graphical Then 
      SetWindowLong Ctrl.hWnd, GWL_STYLE, GetWindowLong(Ctrl.hWnd, _ 
         GWL_STYLE) Or BS_PUSHLIKE 
   Else 
      SetWindowLong Ctrl.hWnd, GWL_STYLE, GetWindowLong(Ctrl.hWnd, _ 
         GWL_STYLE) And Not BS_PUSHLIKE 
   End If 

   Ctrl.Refresh 

End Sub

Pou₧itφ - zm∞na stylu pole OptionButton∙:
Dim c As Control 
For Each c In Option1 
   SetButtonStyle c, True 
Next

Zp∞t

Autor: The Bozena