1个回答
展开全部
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = "姓名"
Label2.Text = "性别"
Label3.Text = "爱好"
RadioButton1.Text = "男"
RadioButton2.Text = "女"
CheckBox1.Text = "篮球"
CheckBox2.Text = "羽毛球"
CheckBox3.Text = "足球"
CheckBox4.Text = "乒乓球"
CheckBox5.Text = "下棋"
CheckBox6.Text = "游泳"
TextBox1.Text = ""
Button1.Text = "确定"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String = ""
str = str & TextBox1.Text & " "
If RadioButton1.Checked = True Then
str = str & "性别:男 "
Else
str = str & "性别:女 "
End If
str = str & "兴趣爱好:"
If CheckBox1.Checked = True Then
str = str & "篮球 "
End If
If CheckBox2.Checked = True Then
str = str & "羽毛球 "
End If
If CheckBox3.Checked = True Then
str = str & "足球 "
End If
If CheckBox4.Checked = True Then
str = str & "乒乓球 "
End If
If CheckBox5.Checked = True Then
str = str & "下棋 "
End If
If CheckBox6.Checked = True Then
str = str & "游泳 "
End If
ComboBox1.Items.Add(str)
End Sub
End Class
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询