vb新手有困难,学做简单乘法的程序,求教育!

[复制链接]
查看11 | 回复4 | 2012-7-7 23:31:25 | 显示全部楼层 |阅读模式
Private Sub command1_click()Text1.Text*Text2.Text = Text3.TextEnd Sub改为Private Sub command1_click() Text3.Text=val(Text1.Text)* val(Text2.Text) End Sub在vb里语句结构是结果=运算过程第二,text1.text他是字符型的,是无法运算,用val函数把字符型转化为数字型就可以参与运算...
回复

使用道具 举报

千问 | 2012-7-7 23:31:25 | 显示全部楼层
Text3.Text = Text1.Text*Text2.Text 还应保证Text1和Text2 不等于零。...
回复

使用道具 举报

千问 | 2012-7-7 23:31:25 | 显示全部楼层
Text3.Text = val(Text1.Text)*val(Text2.Text)...
回复

使用道具 举报

千问 | 2012-7-7 23:31:25 | 显示全部楼层
Text3.Text = Str(Val(Text1.Text) * Val(Text2.Text))...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行