110,541
社区成员
发帖
与我相关
我的任务
分享
private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
int width = this.dataGridView1.Columns[e.ColumnIndex].Width;
int height = this.dataGridView1.Rows[e.RowIndex].Height;
DateTimePicker dt = new DateTimePicker();
dt.Location = new Point(this.dataGridView1.RowHeadersWidth + width * e.ColumnIndex, this.dataGridView1.ColumnHeadersHeight + height * e.RowIndex);
dt.Size = new Size(width, height);
this.dataGridView1.Controls.Add(dt);
}