dataGridView1的指定单元格离开时触发什么事件,如何写
1个回答
展开全部
--------------
void datagridview_cellmouseleave(object sender, datagridviewcelleventargs e)
{
if (datagridview.rowcount >= 2 && datagridview.columncount >= 2)
{
if (datagridview.currentcell.rowindex == 1 && datagridview.currentcell.columnindex == 1)
{
object cellvalue = datagridview[1, 1].value;
datagridview[2, datagridview.currentcell.rowindex].value = cellvalue;
}
void datagridview_cellmouseleave(object sender, datagridviewcelleventargs e)
{
if (datagridview.rowcount >= 2 && datagridview.columncount >= 2)
{
if (datagridview.currentcell.rowindex == 1 && datagridview.currentcell.columnindex == 1)
{
object cellvalue = datagridview[1, 1].value;
datagridview[2, datagridview.currentcell.rowindex].value = cellvalue;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询