- 建立一个新的EXE工程,放两个单选,两个复选框如图33。
图33
-
输入代码:
Sub Form1_Check1_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
Text1.Text = "" If Check1.Value Then Text1.Text="你喜欢" & Check1.Caption End If If Check2.Value Then Text1.Text= Text1.Text & "你喜欢" & Check2.Caption End If
End Sub
Sub Form1_Check2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
Text1.Text = "" If Check2.Value Then Text1.Text="你喜欢" & Check2.Caption End If If Check1.Value Then Text1.Text=Text1.Text & "你喜欢" & Check1.Caption End If
End Sub
Sub Form1_genda1_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
If genda1.Value Then Text1.Text="你的性别为" & genda1.Caption End If
End Sub
Sub Form1_genda2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
If genda2.Value Then Text1.Text="你的性别为" & genda2.Caption End If
End Sub