简体   繁体   English

从组合框选择的值传递数据以其他形式填充文本框

[英]passing data from combobox selected values to populate textbox in other forms

I have a program that has a main form that the user selects different options out of combobox's that progressively filter into more specific choices. 我有一个程序,该程序的主要形式是用户从组合框中选择不同的选项,这些选项逐渐过滤为更具体的选择。 an example would be first combobox has groups, the user would select a group. 例如,第一个组合框具有组,用户将选择一个组。 This selection activates the event handler that then opens up the next selection which only lists choices from the selected group. 此选择激活事件处理程序,然后打开下一个选择,该选择仅列出所选组中的选择。

This goes on for about 10 comboboxes. 这继续进行约10个组合框。

I then have form 2,3,4,5 which are loaded into form 1 visually by docking the forms. 然后,我得到了表单2、3、4、5,它们通过对接可视地加载到表单1中。 These forms have text boxes that can be filled by user or by taking the data selected in the combobox's run through an equation and then default information will fill the textboxes. 这些表单具有文本框,用户可以填充文本框,也可以通过在组合框中运行的方程式中选择的数据填充文本框,然后默认信息将填充文本框。

So the problem is I am unable to take the selected items from the users' selections in the cmbox's and move then to the other forms and then load the textboxes I believe an issue i'm having is since both form 1 and 2 load at the same time and the information i'm sending is based off of selections that happen in events of form 1 that I need to create some form of update event in form 2 that refreshes the form when a selection is made on form 1, but I have no idea how to begin that. 所以问题是我无法从cmbox的用户选择中选择选定的项目,然后移至其他表单,然后加载文本框,我相信我遇到的问题是因为表单1和2都加载了同时,我发送的信息基于在表单1的事件中发生的选择,因此我需要在表单2中创建某种形式的更新事件,当在表单1上进行选择时,该事件会刷新表单。不知道如何开始。

因此在form1中引发一个事件( http://msdn.microsoft.com/zh-cn/library/9aackb16(v=vs.110).aspx ),然后在form2中填充所需的内容( 安全地 http:// /msdn.microsoft.com/zh-cn/library/a1hetckb(v=vs.110).aspx )可以在引发事件上传递参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM