C#pictureBox的mousemove事件

Johnny_Bao 2012-09-05 10:21:00

private void pictureBox2_MouseClick(object sender, MouseEventArgs e)
{
m_bOperatorLog = false;
m_bUser = false;
m_OpenDoor = false;
m_FiDoor = false;
Point pt = e.Location;

TreeNode node = dlgSearchTree.treeSearch.GetNodeAt(pt);
if(node == null)
{
return;
}
if (node != null)
{
dlgSearchTree.treeSearch.SelectedNode = node;
}
if (node.Text == "开门记录查询")
{
LoadOpenDoorRecord(1);
}
else if (node.Text == "识别记录查询")
{
LoadFiRecord(1);
}
else if (node.Text == "操作记录查询")
{
LoadOperateLogReport(1);
}
else if (node.Text == "员工查询")
{
LoadUser(1);
}
}

进入程序,点击界面,mousemove事件有时候不触发,在这里下断点,有时候不进这个事件,这是为什么?
...全文
416 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Conmajia 2012-09-05
  • 打赏
  • 举报
回复
PictureBox上面有别的控件就不会触发它的MouseMove
Johnny_Bao 2012-09-05
  • 打赏
  • 举报
回复
是mouseclick事件,断点是下在mouseclick处的,会出现上面问题
bdmh 2012-09-05
  • 打赏
  • 举报
回复
哪有你那个MouseMove事件,你这不是MouseClick吗
这篇文章中我们重点需要实现的是(3)、(4)两项功能,下面我们来介绍具体实现的方法。 第一步,实现ImageComboBoxItem类。 要实现显示图标,当然要给每个项添加与图标相关的信息了,ImageComboBoxItem类应该包括以下内容:文本(Text)、缩进的级别(Level)、图标的索引(ImageIndex、ImageKey),用户数据(Tag)。ImageComboBoxItem类实现了ISerializable接口,实现自定义序列化。ImageComboBoxItem类的类视图如下: 图3 ImageComboxItem类视图 ImageComboBoxItem类的代码如下: [Serializable] [DefaultProperty("Text")] [TypeConverter( typeof(ExpandableObjectConverter))] public class ImageComboBoxItem : IDisposable, ISerializable ...{ Fields#region Fields private ImageComboBox _imageComboBox; private string _text = "ImageComboBoxItem"; private ImageComboBoxItemImageIndexer _imageIndexer; private object _tag; private int _level; #endregion Constructors#region Constructors public ImageComboBoxItem() ...{ } public ImageComboBoxItem(string text) : this(text, -1, 0) ...{ } public ImageComboBoxItem( string text, int imageIndex) : this(text, imageIndex, 0) ...{ } public ImageComboBoxItem( string text, string imageKey) : this(text, imageKey, 0) ...{ } public ImageComboBoxItem( string text, int imageIndex, int level) : this() ...{ _text = text; ImageIndexer.Index = imageIndex; _level = level; } public ImageComboBoxItem( string text, string imageKey, int level) : this() ...{ _text = text; ImageIndexer.Key = imageKey; _level = level; } protected ImageComboBoxItem( SerializationInfo info, StreamingContext context) : this() ...{ Deserialize(info, context); } #endregion Properties#region Properties [Localizable(true)]

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧