VB程序设计题

程序设计题:
在窗体上设计一个按钮控件,标题为“签到”,点击后分别弹出三个输入框,显示内容为要求输入姓名,学号,专业,其中学号输入框的默认值是”2013054001”,其余两个输入框默认值为空,框的标题为空,等用户输入完毕后,程序弹出消息框,标题为“签到结果”,符号模式为vbinformation, 显示内容形式为:“学生:姓名+学号后三位+专业于 XX年XX月XX日签到”。

在线等,急求!!!!!!!

Dim 姓名 As String = InputBox("请输入你的姓名:")
Dim 学号 As String = InputBox("请输入你的学号:", "", "2013054001")
Dim 专业 As String = InputBox("请输入你的专业:")
If 姓名 IsNot Nothing And 学号 IsNot Nothing And 专业 IsNot Nothing Then
Dim 学号后三位 As String = 学号.Substring(7, 3)
MessageBox.Show("学生:" & 姓名 & ",学号后三位:" & 学号后三位 & " 专业:" & 专业 & " 于 " & Now.Date & " 签到。", "签到结果", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
End If
温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-09-26
Private Sub Command1_Click()
Dim xm, xh, zy
xm = InputBox("请输入姓名")
xh = InputBox("请输入学号", , "2013054001")
zy = InputBox("请输入专业")
MsgBox "学生:" & xm & "," & Right(xh, 3) & "," & zy & "专业于" & Format(Now, "Long Date") & "签到", vbInformation, "签到结果"
End Sub

第2个回答  2014-09-26
Private Sub Command1_Click()
Dim strName As String, strStuNum As String, strMajor As String

'姓名
strName = InputBox("输入姓名", "", "")
'学号
strStuNum = InputBox("输入学号", "", "2013054001")
'专业
strMajor = InputBox("输入专业", "", "")

'弹出框
MsgBox "学生:" & strName & "+" & Right(strStuNum, 3) & "+" & strMajor & "于 " & Year(Date) & "年" & Month(Date) & "月" & Day(Date) & "日签到", vbInformation, "签到结果"
End Sub
Private Sub Form_Load()
Command1.Caption = "签到"
End Sub
第3个回答  2014-09-26
inputbox()
msgbox()