System.Windows.Forms.ComboBox.SelectAll C# (CSharp) Method

SelectAll() public method

public SelectAll ( ) : void
return void
		public void SelectAll ()
		{
			if (dropdown_style == ComboBoxStyle.DropDownList)
				return;
			
			if (textbox_ctrl != null)
			{
				//textbox_ctrl.ShowSelection = true;
				//TODO
				//textbox_ctrl.SelectAll ();
			}
		}

Usage Example

Example #1
0
 private void PropertyView_DoubleClick(object sender, EventArgs e)
 {
     lvItem_ = this.GetItemAt(mx_, my_);
     if (lvItem_ != null)
     {
         int x1 = this.Columns[0].Width + 2;
         if (mx_ >= x1)
         {
             int      x2   = x1 + this.Columns[1].Width;
             int      r    = lvItem_.Index;
             Property prop = (Property)propList_[r];
             if (prop.isSelection())
             {
                 addSelections(prop.getOptions());
                 comboBox_.Size     = new System.Drawing.Size(x2 - x1, lvItem_.Bounds.Height);
                 comboBox_.Location = new System.Drawing.Point(x1, lvItem_.Bounds.Top);
                 comboBox_.Show();
                 comboBox_.Text = lvItem_.SubItems[1].Text;
                 comboBox_.SelectAll();
                 comboBox_.Focus();
             }
             else
             {
                 editBox_.Size     = new System.Drawing.Size(x2 - x1, lvItem_.Bounds.Height - 2);
                 editBox_.Location = new System.Drawing.Point(x1, lvItem_.Bounds.Top);
                 editBox_.Show();
                 editBox_.Text = lvItem_.SubItems[1].Text;
                 editBox_.SelectAll();
                 editBox_.Focus();
             }
         }
     }
 }
All Usage Examples Of System.Windows.Forms.ComboBox::SelectAll