Exemplo n.º 1
0
        public IDock()
        {
            this._DockSize      = new Size(2, 2);
            this._DockLoacation = new Point(0, 0);
            this._metorColor    = Color.FromArgb(0xbf, 0xcf, 0xd8);
            this._title         = string.Empty;
            this._buttons       = new List <IDockClickEventArgs>();
            this.MoveRectangle  = Rectangle.Empty;
            this.OldPoint       = Point.Empty;
            this.InitializeComponent();
            base.Width = Common.HeadWidth - 10;
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.ResizeRedraw, true);
            IDockClickEventArgs item = new IDockClickEventArgs {
                Image = Resources.close
            };

            item.Click += new EventHandler(this.close_Click);
            IDockClickEventArgs args2 = new IDockClickEventArgs {
                Image = Resources.advanced
            };

            args2.Click += new EventHandler(this.manager_Click);
            this.ToolMenu.Add(item);
            this.ToolMenu.Add(args2);
            this.MoveRectangle = new Rectangle(0, 0, base.Width, 0x19);
        }
Exemplo n.º 2
0
 protected override void OnMouseClick(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         Point position = Cursor.Position;
         position = base.PointToClient(position);
         IDockClickEventArgs button = this.GetButton(position);
         if (button != null)
         {
             button.OnClick(this, null);
         }
     }
     base.OnMouseClick(e);
 }