TreeView中有GetNodeAt(Point)方法,Listbox中怎么处理?
解决方案 »
- 高手们VS2010 C#一拖动鼠标选中代码就出错,怎么回事??
- 发帖了,求大神帮助啊!
- Remoting客户端使用log4net的问题?
- 要给某个进程的某个窗体窗口发消息,必须激活它吗
- DATAGRID所碰到的一个问题,急,谢
- 怪事!从html页面的form表单不能向.aspx页面提交!(在线等)
- 我的一些软件作品,觉得好的顶一下
- System.Text.RegularExpressions.Regex.IsMatch(filename,"^.") 和 (filename,“^.”)啥意思
- “系统默认的初始化会将会在所有代码执行前把一切都设置成0或者null”的执行位置?
- C#如何重定向打开FTP登录界面
- c#调用imgdecmp.dll
- C#中怎样修改文件名?
// {
// object o=GetItemAt(this.listBox1,e.X,e.Y);
// if (o!=null) this.Text=o.ToString();
// }
private object GetItemAt(ListBox listBox,int X,int Y)
{
object res=null;
for (int i=0;i<listBox.Items.Count;i++)
{
System.Drawing.Rectangle r=listBox.GetItemRectangle(i);
if (r.Contains(new Point(X,Y)))
{
res=listBox.Items[i];
break;
}
}
return res;
}