예제 #1
0
 protected override void OnDoubleClick(EventArgs e)
 {
     foreach (var item in Items)
     {
         if (item is Item)
         {
             Item it = (Item)item;
             if (it.Bounds.Contains(m_ptMousePos))
             {
                 if (ItemClick != null)
                 {
                     ItemClick(it, e);
                 }
                 break;
             }
         }
         if (item is PluginItem)
         {
             PluginItem it = (PluginItem)item;
             if (it.Bounds.Contains(m_ptMousePos))
             {
                 if (ItemClick != null)
                 {
                     ItemClick(it, e);
                 }
                 break;
             }
         }
     }
     base.OnDoubleClick(e);
 }
예제 #2
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     foreach (var item in Items)
     {
         //if (item is MvItem)
         //{
         //    MvItem it = (MvItem)item;
         //    it.MouseHover = false;
         //    if (it.Bounds.Contains(m_ptMousePos))
         //    {
         //        if (new Rectangle(it.Bounds.X +it.Bounds.Width-27, it.Bounds.Y + 132,25,25).Contains(m_ptMousePos))//播放按钮区域
         //        {
         //            it.MouseHover = true;
         //            it.IsPlayHover = true;
         //            this.Invalidate();
         //        }
         //        else
         //        {
         //            it.MouseHover = true;
         //            this.Invalidate();
         //        }
         //    }
         //}
         if (item is PluginItem)
         {
             PluginItem it = (PluginItem)item;
             if (it.Bounds.Contains(m_ptMousePos))
             {
                 if (new Rectangle(it.Bounds.X + Width - 80, it.Bounds.Y + 30, 45, 28).Contains(m_ptMousePos))//播放按钮区域
                 {
                     it.MouseHover = true;
                     this.Invalidate();
                 }
                 else
                 {
                     it.MouseHover = false;
                     this.Invalidate();
                 }
             }
         }
     }
     base.OnMouseMove(e);
 }