询问有关vb.net的问题 [英] asking question about vb.net

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

问题描述

我有两个表单(正常和添加值)和一个单选按钮和一个正常形式的组合框当我们检查单选按钮时,添加值表单将打开,之后我有一个文本框和一个数据网格视图和当我们在文本框中输入值时两个按钮,然后通过按下addvalue按钮将该值添加到数据网格视图,并在同一页面的datagrid视图中输入值后,我有另一个按钮(ok)whern我按下ok按钮值在组合框中以正常形式出现(表示我的第一个表单)。但是请记住,我在addvalue表单中输入值nopt以addvalue形式保存,值值以组合框的正常形式出现,之后保存。

I have two form (normal and add value)and one radio button and one combo box in normal form when we checked the radio button the add value form will be open and after that i have one text box and a datagrid view and two button when we enter the value in the text box then that value add to the data grid view by pressing the addvalue button and after inputting value in the datagrid view in the same page i have another button (ok) whern i press ok button that value come in to the normal form in the combo box (means my first form).But Remember which i inputting value in the addvalue form does nopt save in the addvalue form that value value comes in the normal form of the part of combo box and after that save.

推荐答案

试图跋涉这是痛苦的!请将来考虑使用至少一些标点符号...如果可以的话;请阅读您的问题,我们无法回答。 :笑:



所以,你有两种形式:

Trying to wade through that is painful! Please, in future, consider using at least some punctuation...if we can;t read your question, we can't answer it. :laugh:

So, you have two forms:
Form1
   Radio button 
   Combobox




Form2
   Textbox
   DataGridView
   ButtonOne
   ButtonTwo
   OKButton



当用户在Form1中检查RadioButton时显示Form2。

您在DataGridView中输入数据并按OK。此时,您希望将信息从DataGridView传输到Form1中的Combobox。



有几种方法可以执行此操作:如果使用ShowDialog显示Form2 ,然后让OK按钮关闭Form2,并通过Form1代码中的属性获取新数据:


You display Form2 when the user checks RadioButton in Form1.
You enter data in the DataGridView and press OK. At this point you want to transfer information from the DataGridView to the Combobox in Form1.

There are a couple of ways to do this: If you use ShowDialog to display Form2, then just let the OK button close Form2, and pick up the new data via properties in teh Form1 code:

Dim f2 As New Form2()
f2.ShowDialog
' Use f2.Properties here to access the new values



如果你使用Show来显示新的Form2实例,那么它就更复杂了:你需要在Form2处理的Form2中创建一个事件,然后使用访问handler方法中的Form2属性。 sender 用于标识Form2实例的参数。


If you use Show to display the new Form2 instance, then it's more complex: you need to create an event in Form2 which Form1 handles, and then access the Form2 properties in the handler method, using the sender parameter to identify the Form2 instance.


这篇关于询问有关vb.net的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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