如题 winform下鼠标换行怎么让鼠标所在行变色呢 贴下代码 谢谢
解决方案 »
- 下位机访问PC的数据库
- c#开发winform时Process调用exe程序,win7下毫无问题,XP下运行不了
- 在winform中windows media player控件弹出文件类型不匹配的警告窗口
- 页面插入的播放器,如何加入暂停 播放按钮
- 请高手指点一下学习方向
- 如何赚下载资源分
- C#怎样判断picture字段中没有保存有任何picture文件?
- 问一个对话框的问题。。。
- 有关Infragistics.Win.UltraWinGrid控件问题
- dataAdapter多表update的问题
- ( C# )定义char a='1';int b=convert.toint16(a);为什么输出的是49而不是1?
- C# WinForm 的即时聊天,如何发送文字+图片?
public Color color = Color.Red;
private void dataGridView2_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0)
{
return;
}
color = this.dataGridView2.Rows[e.RowIndex].DefaultCellStyle.BackColor;
this.dataGridView2.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Red;
} private void dataGridView2_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0)
{
return;
}
this.dataGridView2.Rows[e.RowIndex].DefaultCellStyle.BackColor = color;
}我做的是在DataGridView的鼠标进入和鼠标离开事件里面完成了。