初学写的空间应用有问题
VB与C++很不一样,有错请指出Private Sub CmbBJ_Click()
BJ = CmbBJ.Text
End Sub
Private Sub CmbXM_Click()
XM = CmbXM.Text
End Sub
Private Sub Command1_Click()
TxtResult.Text = "你选择的是" + BJ + "的" + XM
End Sub
这好像输出不了。只有"你选择的是"。全部代码如下
程序代码:
Private Sub CheckCXT_Click() If CheckCXT.Value = 1 Then TxtResult.FontBold = True TxtResult.FontItalic = True Else TxtResult.FontBold = False TxtResult.FontItalic = False End If End Sub Private Sub ChkHT_Click() If ChkHT.Value = 1 Then TxtResult.FontName = "黑体" Else TxtResult.FontName = "宋体" End If End Sub Private Sub CmbBJ_Click() BJ = CmbBJ.Text End Sub Private Sub CmbXM_Click() XM = CmbXM.Text End Sub Private Sub Command1_Click() TxtResult.Text = "你选择的是" + BJ + "的" + XM End Sub Private Sub Command2_Click() If CmbXM.ListIndex > 0 Then CmbXM.RemoveItem CmbXM.ListIndex End If TxtResult.Text = "" End Sub Private Sub Command3_Click() End End Sub Private Sub Form_Load() CmbXM.AddItem "冠 心" CmbXM.AddItem "王丽萍" CmbXM.AddItem "李 明" CmbXM.AddItem "刘 静" CmbXM.AddItem "顾 明" CmbXM.AddItem "吴水军" CmbXM.AddItem "张春燕" CmbBJ.AddItem "电子一班" CmbBJ.AddItem "电子二班" CmbBJ.AddItem "电子三班" CmbBJ.AddItem "化学一班" CmbBJ.AddItem "材料一班" CmbBJ.ListIndex = 0 CmbXM.ListIndex = 0 End Sub Private Sub Opt10_Click() TxtResult.FontSize = 10 End Sub Private Sub Opt12_Click() TxtResult.FontSize = 12 End Sub