private void listBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if(鼠标指针不在当前选中行上) 鼠标指针移动到选中行;
}
{
if(鼠标指针不在当前选中行上) 鼠标指针移动到选中行;
}
解决方案 »
- 推荐几款c# winform方面的加壳软件给我哦.
- 如何在独立的进程打开Excel文件
- 群发邮件,如何写一个操作126邮箱的程序
- 求N+(N+1)+(N+2)+...(N+M)=?
- 如何得到某个时间和当前时间相差的分钟数?
- 求日期控件(WinForm下);
- 在C#里面怎么备份和恢复数据库(SQL SEVER)?
- 【推荐】Infragistics NetAdvantage 2004 Vol.2 COM/.NET/ASP.NET
- Web应用程序的发布
- DataGrid如何使Cell显示图片
- 帮我看看 我写对CheckBoxList是否选中的判断怎么横为假?
- 如何读取另外一个程序的*.exe.CONFIG里的数据
{
Point pt = new Point();
pt.X = listBox1.Width / 2;
pt.Y = listBox1.SelectedIndex * listBox1.ItemHeight + listBox1.ItemHeight / 2;
Cursor.Position = listBox1.PointToScreen(pt);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listBox1.SelectedIndex != -1)
{
Rectangle rt = listBox1.GetItemRectangle(listBox1.SelectedIndex);
Cursor.Position = listBox1.PointToScreen(rt.Location);
}
}