title: What keyboard shortcut to be used for Mouse Double Click in Sendkeys.Send()
body: <p>I need to double click the Masked Textbox which is inside datagridview.</p>
  
  <p>But when i try to enter some value after the masked textbox gets focus, I am not able to enter any value. But I can able to enter a value when i double click using mouse. So i checked by writing SendKeys.Send("{F2}") in DataGridView.KeyPress event which works for all the normal columns to edit(like textbox), but not able to enter a value in MaskedTextBox.</p>
  
  <p>Please assist me on the SendKeys.Send() for mouse double click.</p>
  
  <p>In the DataGridView, key press event tried to call sendKeys.send("{F2}").</p>
  
  <p>sendKeys.send("{F2}")</p>
  
  <p>When the Masked textbox inside datagridview comes to focus, user should be able to enter a value.</p>
  
  <p>Below is my sample coding : </p>
  
  <pre><code>private void Form7_Load(object sender, EventArgs e)
  {
     DataGridViewComboBoxColumn TpyeCol = new DataGridViewComboBoxColumn();
     TpyeCol.Name = "Type";
     TpyeCol.HeaderText = "Type";
     TpyeCol.Items.AddRange(new string[] { "Home Phone", "Cell", "Work", "Email" });
     this.dataGridView1.Columns.Add(TpyeCol);
     this.dataGridView1.Columns.Add("Description", "Description");
     this.dataGridView1.Rows.Add("Home Phone","");
     this.maskedTextBox = new MaskedTextBox();
     this.maskedTextBox.Visible = false;
     this.dataGridView1.Controls.Add(this.maskedTextBox);
     this.dataGridView1.CellBeginEdit += new DataGridViewCellCancelEventHandler(dataGridView1_CellBeginEdit);
     this.dataGridView1.CellEndEdit += new DataGridViewCellEventHandler(dataGridView1_CellEndEdit);
     this.dataGridView1.Scroll += new ScrollEventHandler(dataGridView1_Scroll);
  }
  
  void dataGridView1_Scroll(object sender, ScrollEventArgs e)
  {
     if (this.maskedTextBox.Visible)
     {
         Rectangle rect = this.dataGridView1.GetCellDisplayRectangle(                                                  this.dataGridView1.CurrentCell.ColumnIndex,                    this.dataGridView1.CurrentCell.RowIndex, true);
         this.maskedTextBox.Location = rect.Location;
      }
  }
  
  void dataGridView1_CellBeginEdit(object sender,DataGridViewCellCancelEventArgs e)
  {
     if (e.ColumnIndex == this.dataGridView1.Columns["Description"].Index &amp;&amp;
         e.RowIndex &lt; this.dataGridView1.NewRowIndex)
     {
         string type = this.dataGridView1["Type",e.RowIndex].Value.ToString();
         if (type == "Home Phone" || type == "Cell" || type == "Work")
         {
            this.maskedTextBox.Mask = "00/00/0000";
            Rectangle rect =                      this.dataGridView1.GetCellDisplayRectangle(e.ColumnIndex,e.RowIndex,true);
            this.maskedTextBox.Location = rect.Location;
            this.maskedTextBox.Size = rect.Size;
            this.maskedTextBox.Text = "04/02/2019";
            if (this.dataGridView1[e.ColumnIndex, e.RowIndex].Value != null)
            {
                this.maskedTextBox.Text = this.dataGridView1[e.ColumnIndex,
                e.RowIndex].Value.ToString();
            }
            this.maskedTextBox.Visible = true;
         }
     }
  }
  
  void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
  {
     if (this.maskedTextBox.Visible)
     {
         this.dataGridView1.CurrentCell.Value = this.maskedTextBox.Text;
         this.maskedTextBox.Visible = false;
     }
  } 
  
  void dataGridView1_KeyPress(object sender, DataGridKeyPressEventArgs e)
  {
     If(dataGridView1.ColumnIndex = 1)
     {
        SendKeys.Send("{F2}") //To Point cursor in position 1 of Masked TextBox but not able to edit the masked textbox in DGV
     }
  }
  MaskedTextBox maskedTextBox;
  </code></pre>