[英]Combobox value from first page show in textbox of second page
Add this code in the submit Button_click
在提交
Button_click
添加此代码
Form2.TextBox1.Text = cboMyCombo.SelectedValue();
Form2.Show();
you can access to your ComboBox Item by comboBox.SelectedItem
and then to pass it's value to another form in another class, this couls be helpful: 您可以通过
comboBox.SelectedItem
访问您的ComboBox Item,然后将其值传递给另一个类中的另一种形式,这对您有帮助:
How to display Multiple values from form1 to form3 如何显示从Form1到Form3的多个值
On the form where you have the ComboBox on the click of Submit Button you can do something like this 在具有“提交”按钮单击的“组合框”的表单上,您可以执行以下操作
Letz say your Page1 is ExtCourse than 让我们说您的Page1比
ExtCourse.CourseName = ComboBoxCourse.GetItemText(this.ComboBoxCourse.SelectedItem);
and on ExtCourse.cs 以及在ExtCourse.cs上
public string CourseName { get; set; }
than you can assign 比你可以分配的
TextBoxCourseName.Text = CourseName;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.