vb总是出现缺少子程序 函数或属性 是怎么回事?
PrivateSubCommand1_Click(indexAsInteger)index0--16index0-9,Caption=0-9index10,Caption...
Private Sub Command1_Click(index As Integer)
index 0 - -16
index 0 - 9, Caption = 0 - 9
index 10, Caption = "."
index 11, Caption = "="
index 12, Caption = "+"
index 13, Caption = "-"
index 14, Caption = "*"
index 15, Caption = "/"
index16 , Caption = "清除"
Dim index As Integer
Select Case index
Case 0 To 9
If firstnum Then
strnum1 = Str(index)
firstnum = False
Else
strnum1 = strnum1 + strnum(index)
End If
Text1.Text = strnum1
End Select
End Sub 展开
index 0 - -16
index 0 - 9, Caption = 0 - 9
index 10, Caption = "."
index 11, Caption = "="
index 12, Caption = "+"
index 13, Caption = "-"
index 14, Caption = "*"
index 15, Caption = "/"
index16 , Caption = "清除"
Dim index As Integer
Select Case index
Case 0 To 9
If firstnum Then
strnum1 = Str(index)
firstnum = False
Else
strnum1 = strnum1 + strnum(index)
End If
Text1.Text = strnum1
End Select
End Sub 展开
展开全部
只能说你的程序语法错误一大堆,可能是从来没有写过vb的。
我修改了一下你的代码如下:
Dim firstnum As Boolean
Dim strnum1 As String
Private Sub Command1_Click(index As Integer)
Select Case index
Case 0 To 9
If firstnum Then
strnum1 = Trim(Str(index))
firstnum = False
Else
strnum1 = strnum1 & Trim(Str(index))
End If
Text1.Text = strnum1
End Select
End Sub
Private Sub Form_Load()
Dim index As Integer
For index = 0 To 9
Command1(index).Caption = index
Next index
Command1(10).Caption = "."
Command1(11).Caption = "="
Command1(12).Caption = "+"
Command1(13).Caption = "-"
Command1(14).Caption = "*"
Command1(15).Caption = "/"
Command1(16).Caption = "清除"
firstnum = True
strnum1 = ""
End Sub
我建议你还是先找本基础书籍来看一下。
我修改了一下你的代码如下:
Dim firstnum As Boolean
Dim strnum1 As String
Private Sub Command1_Click(index As Integer)
Select Case index
Case 0 To 9
If firstnum Then
strnum1 = Trim(Str(index))
firstnum = False
Else
strnum1 = strnum1 & Trim(Str(index))
End If
Text1.Text = strnum1
End Select
End Sub
Private Sub Form_Load()
Dim index As Integer
For index = 0 To 9
Command1(index).Caption = index
Next index
Command1(10).Caption = "."
Command1(11).Caption = "="
Command1(12).Caption = "+"
Command1(13).Caption = "-"
Command1(14).Caption = "*"
Command1(15).Caption = "/"
Command1(16).Caption = "清除"
firstnum = True
strnum1 = ""
End Sub
我建议你还是先找本基础书籍来看一下。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询