I try to open a form just below a DataGridView
header cell. I have this (and it is not working):
private void button1_Click(object sender, EventArgs e)
{
Form aForm = new Form();
aForm.Text = @"Test";
aForm.Top = this.Top + dataGridView1.Top - dataGridView1.GetCellDisplayRectangle(0, 0, false).Height;
aForm.Left = this.Left + dataGridView1.GetCellDisplayRectangle(0, 0, false).Left;
aForm.Width = 25;
aForm.Height = 100;
aForm.ShowDialog();
}
I don't see how to get the right top and left based on the DataGridView
cell.