Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#组合框选择新项目_C#_Winforms - Fatal编程技术网

C#组合框选择新项目

C#组合框选择新项目,c#,winforms,C#,Winforms,是否可以将组合框的选定项设置为不在其下拉列表中的对象 如果是,则必须执行什么操作?使用属性: comboBox.Text = "I'm not in the list!"; 如果要将项目添加到列表中,请使用集合: comboBox.Items.Add("I was added to the list!"); 使用属性: comboBox.Text = "I'm not in the list!"; 如果要将项目添加到列表中,请使用集合: comboBox.Items.Add("I was

是否可以将组合框的选定项设置为不在其下拉列表中的对象

如果是,则必须执行什么操作?

使用属性:

comboBox.Text = "I'm not in the list!";
如果要将项目添加到列表中,请使用集合:

comboBox.Items.Add("I was added to the list!");
使用属性:

comboBox.Text = "I'm not in the list!";
如果要将项目添加到列表中,请使用集合:

comboBox.Items.Add("I was added to the list!");

是否存在在生成对象后无法将其添加到列表中的原因?对象是异步生成的吗

myComboBox.Items.Add(newItem);

是否存在在生成对象后无法将其添加到列表中的原因?对象是异步生成的吗

myComboBox.Items.Add(newItem);

如何选择不存在的对象?还是我没有领会你的意思?我想使用控件让用户指向多个业务对象中的任意一个。下拉列表提供常用对象的列表,但用户可能还希望指向由另一个控件动态生成的对象。如果这被证明是太模糊了,那么我将尝试构建一个足够小的示例来说明我稍后要做的事情。您希望如何选择一个不存在的对象?还是我没有领会你的意思?我想使用控件让用户指向多个业务对象中的任意一个。下拉列表提供常用对象的列表,但用户可能还希望指向由另一个控件动态生成的对象。如果这被证明太模糊,那么我将尝试构建一个足够小的示例,说明我稍后要做的事情。