【发布时间】:2014-09-01 19:26:21
【问题描述】:
我想在组合框中设置文本。下面是代码-
private System.Windows.Forms.ComboBox selectModel;
this.selectModel = new System.Windows.Forms.ComboBox();
this.selectModel.Name = "selectModel";
this.selectModel.FormattingEnabled = true;
this.selectModel.Size = new System.Drawing.Size(64, 21);
this.selectModel.Location = new System.Drawing.Point(3, 76);
this.selectModel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
以下行不起作用-
selectModel.SelectedText = getModelNameFromConf();
文档说 “它获取或设置在 ComboBox 的可编辑部分中选择的文本”。我无法使其对用户可编辑。
请提供任何解决方法。
【问题讨论】:
-
它是 Windows 窗体应用程序吗?为什么是 ASP.NET 标签?