VB.Net通过单击按钮从表单获取数据到另一个表单 [英] VB.Net Get data from a form with button click to another form

查看:288
本文介绍了VB.Net通过单击按钮从表单获取数据到另一个表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好..

我没有第一个问题飞机的答案@但我有另一个问题:

我想通过单击从表单到另一表单的按钮来显示信息.

有人可以向我解释,我可以做到吗?

thanx

hello..

i don''t have a answer @ my first question jet but i have another one:

i wanna show the info by click on a button from a form into another form.

can someone explain it to me ho i can do that?

thanx

推荐答案

以下是第一个表单按钮单击事件的代码:
Here is the code for the first forms button click event:
Private Sub button1_Click(sender As Object, e As EventArgs)
    Dim frm2_1 As New Form2("Hello")
    frm2_1.Show()
    Dim frm2_2 As New Form2("World")
    frm2_2.Show()
End Sub


对于第二种形式的构造函数,您可以使用类似以下内容的方法:


and for the constructor of the second form you could use something like that:

Namespace WindowsFormsApplication1
	Public Partial Class Form2
		Inherits Form
		Public Sub New(strContent As String)
			InitializeComponent()
			textBox1.Text = strContent
		End Sub
	End Class
End Namespace


感谢您的帮助!
我试过了您的代码,它对我来说很好用,现在我将尝试将其放入我自己的项目中.

thnx(Y)
Thanx for your help!
i Tried your code and it works fine to me, now i''m gonna try to get it into my own project.

thnx (Y)


这篇关于VB.Net通过单击按钮从表单获取数据到另一个表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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