在表单之间传递数据的方法(VB 2008) [英] Way to pass data between forms (VB 2008)

查看:22
本文介绍了在表单之间传递数据的方法(VB 2008)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这种方式是在两个表单之间传递数据的正确"方式吗?

Is this way a "right" way to pass data between two forms?

'Form1 code

Public Class Form1

Public str As New String = "This is the string"

'...more code

End Class


'Form2 code

Public Class Form2

Public str2 As New string = ""

Private Sub Form2_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load

str2 = Form1.str

End Sub

'...more code

End Class

先谢谢你,

塔索斯

推荐答案

在 form1 代码中..

In form1 code..

把它放在按钮代码或者你会用到的东西里...

put this in button code or something that you will use...

Form2.str2.Tostring = str.Tostring()

我希望我能给你一些想法......

I hopes i give you idea....

这篇关于在表单之间传递数据的方法(VB 2008)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆