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
展开
 我来答
sanwkj
2009-10-14 · TA获得超过126个赞
知道小有建树答主
回答量:154
采纳率:0%
帮助的人:118万
展开全部
只能说你的程序语法错误一大堆,可能是从来没有写过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
我建议你还是先找本基础书籍来看一下。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式