Create a textbox control, with dimensions to simulate a checkbox. Try the following properties
Property | Property Value |
Name | MyCheckbox1 |
Height | 240 |
TabStop | No |
Width | 240 |
Add a label, MyCheckBoxLabel1, next to the textbox , and type the following code
Private Sub MyCheckBox1_Click()
'If the user clicks the textbox, it shall switch between empty and "X"
If Text1.Text = "X" Then
Text1.Text = ""
Else
Text1.Text = "X"
End If
'Send focus away in order not to see the cursor
Me.SetFocus
End Sub
Private Sub MyCheckBoxLabel1_Click()
'A click on the label shall be received as a click on the textbox
MyCheckBox1_Click
End Sub
To check whether the "checkbox" has been selected, you will of course have to
check whether
MyCheckBox1.Text = "X"