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