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

Select() public method

public Select ( int start, int length ) : void
start int
length int
return void
		public void Select(int start, int length)
		{
			m_helper.TextView.SelectedRange = new NSRange(start,length);
		}

Usage Example

Example #1
0
 public static void SetRichTextBoxDropString(System.Windows.Forms.TextBoxBase yourCtr, Action action = null)
 {
     if (yourCtr == null)
     {
         return;
     }
     if (yourCtr is RichTextBox)
     {
         ((RichTextBox)yourCtr).AllowDrop = true;
     }
     else if (yourCtr is TextBox)
     {
         ((TextBox)yourCtr).AllowDrop = true;
     }
     else
     {
         yourCtr.AllowDrop = true;
     }
     yourCtr.DragDrop += (sender, e) =>
     {
         System.Windows.Forms.TextBoxBase tempTextBoxBase = sender as System.Windows.Forms.TextBoxBase;
         string tempText = (string)e.Data.GetData(typeof(string));
         if (tempText == null || tempTextBoxBase == null)
         {
             return;
         }
         int selectionStart = tempTextBoxBase.SelectionStart;
         tempTextBoxBase.Text = tempTextBoxBase.Text.Insert(selectionStart, tempText);
         tempTextBoxBase.Select(selectionStart, tempText.Length);
         action?.Invoke();
     };
     yourCtr.DragEnter += (sender, e) =>
     {
         if (e.Data.GetData(typeof(string)) == null)
         {
             e.Effect = System.Windows.Forms.DragDropEffects.None;
         }
         else
         {
             e.Effect = System.Windows.Forms.DragDropEffects.Move;
         }
     };
 }
All Usage Examples Of System.Windows.Forms.TextBoxBase::Select