勤能补拙,学无止境!
——无大志常立志,常志不移!

在设置双击单元格提取单元格内容时,只有在文字内容上双击才会提取到单元格内容,如果你双击同一单元格的非文字区域就不能提取单元格内容。

双击事件源码如下:
private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            maskedTextBoxFcllx.Text = dataGridView1.Rows[dataGridView1.CurrentCellAddress.Y].Cells["Column1"].Value.ToString();
            maskedTextBoxFcllxmc.Text = dataGridView1.Rows[dataGridView1.CurrentCellAddress.Y].Cells["Column2"].Value.ToString();
            comboBoxFcllxgl.Text= dataGridView1.Rows[dataGridView1.CurrentCellAddress.Y].Cells["Column3"].Value.ToString();
        }

请高手指点!

posted on 2007-03-25 20:51  JcServer  阅读(2809)  评论(4)    收藏  举报