帮我写个简单的VB代码 谢谢
1个回答
展开全部
Private Sub Command1_Click()
If Check1.Value + Check2.Value + Check3.Value = 0 Then Exit Sub
Text1.Text = "我喜欢的科目是"
If Check1.Value = 1 Then Text1.Text = Text1.Text & Check1.Caption
If Check2.Value = 1 Then Text1.Text = Text1.Text & Check2.Caption
If Check3.Value = 1 Then Text1.Text = Text1.Text & Check3.Caption
End Sub
Private Sub Form_Load()
Check1.Caption = "语文"
Check2.Caption = "数学"
Check3.Caption = "英语"
Text1.Text = ""
End Sub
If Check1.Value + Check2.Value + Check3.Value = 0 Then Exit Sub
Text1.Text = "我喜欢的科目是"
If Check1.Value = 1 Then Text1.Text = Text1.Text & Check1.Caption
If Check2.Value = 1 Then Text1.Text = Text1.Text & Check2.Caption
If Check3.Value = 1 Then Text1.Text = Text1.Text & Check3.Caption
End Sub
Private Sub Form_Load()
Check1.Caption = "语文"
Check2.Caption = "数学"
Check3.Caption = "英语"
Text1.Text = ""
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询