下面这4个代码的注释 谢谢
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0];
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count - 1)
{
MessageBox.Show("已到尾记录!");
return;
}
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex + 1].Cells[0];
f (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count)
{
MessageBox.Show("已到首记录!");
return;
}
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex - 1].Cells[0]; this.dataGridView1.CurrentCell = this.dataGridView1.Rows[0].Cells[0];
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0];
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count - 1)
{
MessageBox.Show("已到尾记录!");
return;
}
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex + 1].Cells[0];
f (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count)
{
MessageBox.Show("已到首记录!");
return;
}
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex - 1].Cells[0]; this.dataGridView1.CurrentCell = this.dataGridView1.Rows[0].Cells[0];
解决方案 »
- 向高手请教.C++中如何调用C#写的DLL
- c#如何 实现QQ登陆界面的的小键盘功能?
- 请问怎样将IE缓存中的一个图片文件, 复制到C盘?
- [up有分] 如何获取指定域用户所在的组?
- 为什么我从微软网站下载petshop3.0数据库不能安装啊
- 关于索引的基本问题
- 比较菜的问题,请大家帮忙,在DATAgrid中,点击超连接行的时候,回传递参数到下个页面。。。。
- WPF,怎样获得Frame装载的page的类实例?
- 请问哪里有下载C# windows编成的书籍
- 如何在程序中,使DataGrid中某个cell的一部分文本变成高亮?
- 邮箱账号和密码的快速验证问题
- 关于Wizard的sidebar和刷新的问题
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0]; //如果当前行号=行数-1 也就是倒数第二行
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count - 1)
{
MessageBox.Show("已到尾记录!");
return;
}
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex + 1].Cells[0];
f (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count)
{
MessageBox.Show("已到首记录!");
return;
}
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex - 1].Cells[0];
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[0].Cells[0];
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0];//判断dataGridView1的当前单元格的行号(索引号)是否等于最后的行号
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count - 1) //dataGridView1的当前单元格的数据等于这个单元格行号+1且第0列单元格的值
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex + 1].Cells[0]; 后面差不多!!
//当前单元格的焦点=倒数第二行的第一单元格
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0];//如果当前单元格的索引==所有行-1的话
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count - 1)
{
MessageBox.Show("已到尾记录!");
return;
}
//当前单元格的焦点=当前单元格的索引+1
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex + 1].Cells[0];//如果当前单元格的索引==所有行的话
f (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count)
{
MessageBox.Show("已到首记录!");
return;
}
//当前单元格的焦点=当前单元格的索引-1
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex - 1].Cells[0];//当前单元格的焦点=倒数第1行的第一单元格
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[0].Cells[0];
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0];//如果当前单元格的索引已经是最后一行的第一个单元格的话,即已到最后行了,给出提示
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count - 1)
{
MessageBox.Show("已到尾记录!");
return;
}
//设置dataGridView1的最后一行的第一个单元格处于激活状态
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0];
//如果dataGridView1的处于激活状态的单元格的行索引等于dataGridView1的最后一行的索引
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count - 1)
{
MessageBox.Show("已到尾记录!");
return;
}
//获取dataGridView1的最后一行的处于激活状态的第一个单元格
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex + 1].Cells[0];//如果dataGridView1的处于激活状态的单元格的行索引等于dataGridView1的最后一行的索引
//这个判断好像永远不成立因为RowIndex不会等于RowCount
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count)
{
MessageBox.Show("已到首记录!");
return;
}
//设置dataGridView1的当前行的第一个单元格处于激活状态
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex - 1].Cells[0];//设置dataGridView1的第一行的第一个单元格处于激活状态
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[0].Cells[0];
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0];//如果当前单元格的索引等于最后一行的索引的情况下弹出一到末尾的提示框下面不再执行
if (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count - 1)
{
MessageBox.Show("已到尾记录!");
return;//停止执行下面代码
}
//使下一行的第一个单元格获取焦点
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex + 1].Cells[0];//如果当前单元格的行索引等于表的记录行数弹出到首记录停止下面代码
f (this.dataGridView1.CurrentCell.RowIndex == this.dataGridView1.Rows.Count)
{
MessageBox.Show("已到首记录!");
return;//通上
}
//当前焦点跳到上一行第一格
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[this.dataGridView1.CurrentCell.RowIndex - 1].Cells[0];//跳到第一行第一格
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[0].Cells[0];上面的有个人的注释有误