VB如何实现打开窗体 填写后返回计算

[复制链接]
查看11 | 回复2 | 2011-2-11 23:08:39 | 显示全部楼层 |阅读模式
在Form1里声明变量a、b、c添加Button1、Button2、TextBox1并且再Button1的Click事件中写出计算方法Button2的Click事件是Form2的ShowPublic Class Form1
Friend a, b, c As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = a + b + c
End Sub
Private...
回复

使用道具 举报

千问 | 2011-2-11 23:08:39 | 显示全部楼层
在一个地方声明全局变量:public a as string然后调用的时候:form1.a = text1.text(把form1改成你声明的地方)。...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行