桌面应用 [英] desktop application

查看:89
本文介绍了桌面应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net中将值从一页传递到另一页?
我已经尝试了以下给定的代码:-
私有_passedText作为字符串
公共属性[PassedText]()作为字符串
获取
返回_passedText
结束获取
设置(ByVal值作为字符串)
_passedText =值
端套
最终财产
然后,当您从Form2声明对象时,只需在显示表单之前设置值
在Form1和Button1 Click事件中,写以下行:
VB.NET语法(切换纯文本)
昏暗的对象作为新的Form2Obj.PassedText = TextBox1.TextObj.ShowDim对象作为新的Form2
Obj.PassedText = TextBox1.Text
对象显示
请帮我...

how to pass value from one page to other in vb.net????

i have tried the below given code:--
Private _passedText As String
Public Property [PassedText]() As String
Get
Return _passedText
End Get
Set(ByVal Value As String)
_passedText= Value
End Set
End Property
Then , when you are declaring Object from Form2 you just set The Value before Showing the Form
in the Form1 and in Button1 Click event write these lines :
VB.NET Syntax (Toggle Plain Text)
Dim Obj As New Form2Obj.PassedText = TextBox1.TextObj.ShowDim Obj As New Form2
Obj.PassedText = TextBox1.Text
Obj.Show
plzz help me...

推荐答案

嗨...

使用静态变量设计一个静态类.以Firts形式(例如Form1)分配值,并以其他形式(例如Form2)使用它..

这是在两个窗口窗体之间传递数据的一种方法...尝试一下.

问候,
SureshKumar
Hi...

Design a Static Class with Static Variables. Assign values in Firts Form (say Form1) and use it in other form (say Form2)..

This is one way to communicate data between two window forms... try it.

Regards,
SureshKumar


这篇关于桌面应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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