有没有办法从表单中传回值。 [英] Is there a way to pass values back from forms.

查看:79
本文介绍了有没有办法从表单中传回值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上正在尝试创建一个带有两个复选框的表单,并希望根据用户对调用表单的选择返回1,2或3(基本上就像消息框一样)

我不知道是否有办法将其传回去而不是抛出错误(这不是错误)或引发事件(这会在模块程序之外设置一个值)


谢谢

I basically am attempting to create a form with two checkboxes and want a 1, 2, or 3 to come back depending on the user choice to the calling form (like a message box, basically)

I didn''t know if there was a way to pass it back other than throwing an error (which isn''t an error) or raising an event (which would set a value outside of the module procedure)

Thanks

推荐答案

这是一种方式。 。 。


如果使用showDialog方法显示带有复选框的表单,则可以继续执行代码并提取表单上选择的值。


将frmCB调暗为新的formChkBx

''将表单置于模态状态,以便使用必须采取行动/这应该是在选择完成后隐藏表单

frmCB.ShowDialog()


''从表单中获取值

''您可以像使用任何其他对象一样使用表单,这样您就可以了可以调用它的属性和方法。


''然后使用dispose方法处理表单。


问候 - OHM


" Stephen Costanzo" < SX ******** @ hotmail.com>在消息新闻中写道:%2 ****************** @ TK2MSFTNGP12.phx.gbl ...

我基本上是在尝试创建表单有两个复选框,想要一个1,2或3回来取决于用户对调用表单的选择(基本上就像一个消息框)


我不知道如果有一种方法可以将其传递回去而不是抛出错误(这不是错误)或引发事件(这会在模块程序之外设置一个值)


谢谢

Here''s one way . . .

if you use showDialog method to show the form with the checkboxs on it, you can then continue with the code execution and extract the value selected on the form.

Dim frmCB as new formChkBx
''Puts the form in modal state so use has to take an action/ this should be to hide the form once the choise has been made
frmCB.ShowDialog()

''get Values from form
''You can use the form like any other object so you can call its properties and methods.

''Then dispose of the form using the dispose method.

Regards - OHM

"Stephen Costanzo" <sx********@hotmail.com> wrote in message news:%2******************@TK2MSFTNGP12.phx.gbl...
I basically am attempting to create a form with two checkboxes and want a 1, 2, or 3 to come back depending on the user choice to the calling form (like a message box, basically)

I didn''t know if there was a way to pass it back other than throwing an error (which isn''t an error) or raising an event (which would set a value outside of the module procedure)

Thanks


*" Stephen Costanzo" < SX ******** @ hotmail.com> scripsit:
* "Stephen Costanzo" <sx********@hotmail.com> scripsit:
我基本上正在尝试创建一个带有两个复选框的表单,并希望返回1,2或3,具体取决于用户选择
到调用表单(如消息)框,基本上)
I basically am attempting to create a form with two checkboxes and want a 1, 2, or 3 to come back depending on the user choice
to the calling form (like a message box, basically)




< http://www.google.com/groups?selm = u5Y8SnOXDHA.1872%40TK2MSFTNGP12.phx.gb l>


-

Herfried K. Wagner [MVP]

< http://www.mvps.org/dotnet>



<http://www.google.com/groups?selm=u5Y8SnOXDHA.1872%40TK2MSFTNGP12.phx.gb l>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


谢谢,


那将是我的下一个问题 - 除了下载17K +标题

如何搜索档案,我不知道我可以谷歌。

" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道

news:bq ************* @ ID-208219.news.uni-berlin.de ...
Thanks,

That was going to be my next question - other than downloading 17K+ headers
how to search the archives, wasn''t aware I could google it.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
*Stephen Costanzo < SX ******** @ hotmail.com> scripsit:
* "Stephen Costanzo" <sx********@hotmail.com> scripsit:
我基本上试图创建一个带有两个复选框的表单,并希望
a 1,2或3回来,具体取决于用户对调用表单的选择(如消息框) ,基本上)
I basically am attempting to create a form with two checkboxes and want a 1, 2, or 3 to come back depending on the user choice to the calling form (like a message box, basically)



< http://www.google.com/groups?selm = u5Y8SnOXDHA.1872%40TK2MSFTNGP12.phx.gb l>
-
Herfried K. Wagner [MVP]
< http://www.mvps.org/dotnet>


<http://www.google.com/groups?selm=u5Y8SnOXDHA.1872%40TK2MSFTNGP12.phx.gb l>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>



这篇关于有没有办法从表单中传回值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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