CodeItBetter Programming Another VB Programming Blog

How to make a Toggle Button

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
'Controls - How to make a Toggle Button

Option Explicit
 
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
    ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Const BM_SETSTATE = &HF3
Private mb_ButtonDown As Boolean
 
Private Sub Command1_Click()
    mb_ButtonDown = Not mb_ButtonDown
    Call SendMessage(Command1.hwnd, BM_SETSTATE, CInt(mb_ButtonDown), 0&)
End Sub
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.