System.Windows.Forms.Control.Select C# (CSharp) Method

Select() private method

private Select ( Control control ) : bool
control Control
return bool
		internal bool Select (Control control)
		{
			IContainerControl container;
			
			if (control == null)
			{
				return false;
			}
			
			container = GetContainerControl ();
			if (container != null && (Control)container != control)
			{
				container.ActiveControl = control;
				if (container.ActiveControl == control && !control.Focused && control.IsHandleCreated)
					control.NSViewForControl.BecomeFirstResponder ();
			}

			else if (control.IsHandleCreated)
			{
				control.NSViewForControl.BecomeFirstResponder ();
			}
			return true;
		}

Same methods

Control::Select ( ) : void
Control::Select ( bool directed, bool forward ) : void

Usage Example

Example #1
0
        private void EditItem(int index, ListViewItem.ListViewSubItem sb)
        {
            if (this.SelectedItems.Count <= 0)
            {
                return;
            }
            int currentSelectColumnIndex = _mCtrls.IndexOfKey(index);

            if (currentSelectColumnIndex == -1)
            {
                return;
            }
            _currentCtrl = (System.Windows.Forms.Control)_mCtrls.Values[currentSelectColumnIndex];
            ListViewItem item  = this.SelectedItems[0];
            Rectangle    rect  = sb.Bounds;
            Rectangle    _rect = new Rectangle(rect.Right - this.Columns[index].Width, rect.Top, this.Columns[index].Width, rect.Height);

            _currentCtrl.Bounds = _rect;
            _currentCtrl.BringToFront();
            _currentCtrl.Text         = item.SubItems[index].Text;
            _currentCtrl.TextChanged += CtrTextChanged;
            _currentCtrl.Leave       += CtrLeave;

            _currentCtrl.Visible = true;
            _currentCtrl.Tag     = item;
            _currentCtrl.Select();
        }
All Usage Examples Of System.Windows.Forms.Control::Select
Control