如何将一个表单的comboBox selectedItem转换为另一个表单
问题描述:
如何将表格中选定的combox项目转换为另一种形式。(connect和Form1)
连接形式:
How to get the selected item of combox in form to another form.(connect and Form1 )
in connect form :
<pre lang="c#"><pre lang="sql">public string machineId
{
get
{
return comboBox1.SelectedItem.ToString();
}
set
{
comboBox1.Text = value;
}
}</pre></pre>
and in Form1;
<pre lang="c#"><pre lang="c#">
Connect c = new Connect();
String machineid=c.machineId;
所以我得到错误:at String machineid = c.machineId
对象引用未设置为对象的实例。
so i got the error as:at String machineid=c.machineId
Object reference not set to an instance of an object.