本文整理匯總了C#中System.Windows.Forms.ComboBox.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# ComboBox.ToString方法的具體用法?C# ComboBox.ToString怎麽用?C# ComboBox.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.ComboBox
的用法示例。
在下文中一共展示了ComboBox.ToString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: InitializeComponent
//.........這裏部分代碼省略.........
"Vilanova de Bellpuig ",
"Vilanova de Meià ",
"Vilanova de Prades ",
"Vilanova de Sau ",
"Vilanova de Segrià ",
"Vilanova de l'Aguda ",
"Vilanova de la Barca ",
"Vilanova del Camí ",
"Vilanova del Vallès ",
"Vilanova i la Geltrú ",
"Vilaplana ",
"Vilassar de Dalt ",
"Vilassar de Mar ",
"Vilaverd ",
"Vilaür ",
"Vilella Alta ",
"Vilella Baixa ",
"Vilobí d'Onyar ",
"Vilobí del Penedès ",
"Vilopriu ",
"Vilosell ",
"Vimbodí ",
"Vinaixa ",
"Vinebre ",
"Vinyols i els Arcs ",
"Viver i Serrateix ",
"Xerta "
});
/* Buttons */
buttonSimple = new Button ();
buttonSimple.Location = new Point (280, 30);
buttonSimple.Text = "Simple";
buttonSimple.Size = new Size (100, 23);
buttonSimple.Click += new System.EventHandler (buttonSimpleClick);
buttonDropDown = new Button ();
buttonDropDown.Location = new Point (280, 80);
buttonDropDown.Text = "DropList";
buttonDropDown.Size = new Size (100, 23);
buttonDropDown.Click += new System.EventHandler (buttonDropDownClick);
buttonDropDownList = new Button ();
buttonDropDownList.Location = new Point (280, 130);
buttonDropDownList.Text = "DropDownList";
buttonDropDownList.Size = new Size (100, 23);
buttonDropDownList.Click += new System.EventHandler (buttonDropDownListClick);
comboBox.Location = new System.Drawing.Point(8, 32);
comboBox.Name = "comboBox";
comboBox.Size = new System.Drawing.Size (248, 150);
comboBox.TabIndex = 0;
//comboBox.Text = "A normal ComboBox";
comboBox.DropDownStyle = ComboBoxStyle.Simple;
comboBox.MaxDropDownItems = 10;
//comboBox.ItemHeight = false;
buttonDropDownAction = new Button ();
buttonDropDownAction.Location = new Point (400, 130);
buttonDropDownAction.Text = "DropDown action";
buttonDropDownAction.Size = new Size (100, 23);
buttonDropDownAction.Click += new System.EventHandler (buttonDropDownListActionClick);
buttonAddItems = new Button ();
buttonAddItems.Location = new Point (400, 30);
buttonAddItems.Text = "Add Items";
buttonAddItems.Size = new Size (100, 23);
buttonAddItems.Click += new System.EventHandler (buttonAddItemsClick);
buttonCleanItems = new Button ();
buttonCleanItems.Location = new Point (400, 80);
buttonCleanItems.Text = "Clean Items";
buttonCleanItems.Size = new Size (100, 23);
buttonCleanItems.Click += new System.EventHandler (buttonCleanItemsClick);
//this.comboBox.IntegralHeight = true;
//comboBox.Font = new System.Drawing.Font (comboBox.Font.FontFamily, comboBox.Font.Size + 5);
//
// MainForm
//
this.ClientSize = new System.Drawing.Size(624, 309);
this.Controls.AddRange(new Control[] { buttonAddItems, buttonCleanItems,
comboBox, buttonSimple, buttonDropDown, buttonDropDownList,
buttonDropDownAction});
this.Text = "Single ComboBox sample";
this.ResumeLayout(false);
Console.WriteLine ("ComboBox Size {0}", comboBox.Size);
Console.WriteLine ("ComboBox IntegralHeight {0}", comboBox.IntegralHeight);
Console.WriteLine ("ComboBox ItemHeight {0}", comboBox.ItemHeight);
Console.WriteLine ("ComboBox FontHeight {0}", comboBox.Font.Height);
Console.WriteLine ("ComboBox String {0}", comboBox.ToString ());
}