当从另一个窗口提交新数据时,如何在窗口上自动刷新组合框 [英] How to automatic refresh combo box on window when new data submited from another window

查看:61
本文介绍了当从另一个窗口提交新数据时,如何在窗口上自动刷新组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在第一个窗口中有一个名为fruits的组合框;有一个linkLabel,我可以从中打开一个新的水果窗口并输入新的水果名称。但在关闭Fruit窗口后,新添加的水果不会显示在主窗体组合框中,但如果我关闭窗体并再次打开它,我可以得到名称。但是我想在关闭水果窗口时在主窗口的组合框中显示水果名称。



请帮我解决这个问题。

在此先感谢。

In the first window there is a combobox named fruits; there is a linkLabel from which i can open a new Fruits window and enter new fruits name. But after closing that Fruits window the newly added fruits are not displayed in the main form combo box, though if i close the form and open it again i can get the names. But i want to display fruit name in the combobox of the main window as soon as i close the fruit window.

Please help me to solve this.
Thanks in advance.

推荐答案

U应该创建一个函数,在插入新的水果名称后,你将把项目添加到ComboBox,现在在Fruits窗口上,在我的意见你用add / ok / submit按钮添加新的水果名称。在那个按钮点击事件调用你的comoboBox添加功能,所以在你添加的每一条记录之后,这个函数将被调用并且bcoz在该函数中你已经写了功能将水果名称添加到comboBox,以便每次插入水果名称时都会更新。
U Should create a function where u will add item to ComboBox,Now on Fruits windows after inserting new fruit name,In my opinion u r using add/ok/submit button to add new fruit name.On that button click event call ur comoboBox add function,so after every record added by u ,this function will be call and bcoz in that function u have written the functionality to add fruit name to comboBox so it will update,every time when a fruit name will insert.


这篇关于当从另一个窗口提交新数据时,如何在窗口上自动刷新组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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