Public Sub SetGraphicStyle(StyleButton As Control, _
Flag As Boolean)
Dim curstyle As Long
Dim newstyle As Long
If Not TypeOf StyleButton Is OptionButton And _
Not TypeOf StyleButton Is CheckBox Then Exit Sub
curstyle = GetWindowLong(StyleButton.hwnd, GWL_STYLE)
If Flag Then
curstyle = curstyle Or BS_PUSHLIKE
Else
curstyle = curstyle And (Not BS_PUSHLIKE)
End If
newstyle = SetWindowLong(StyleButton.hwnd, GWL_STYLE, _
curstyle)
StyleButton.Refresh
End Sub