public ControlBoxMenuItem(Form ownerForm, ControlBoxType type)
            {
                form      = ownerForm;
                this.type = type;

                base.AutoSize     = false;
                base.Alignment    = ToolStripItemAlignment.Right;
                base.Size         = new Size(20, 20);
                base.MergeIndex   = int.MaxValue;
                base.DisplayStyle = ToolStripItemDisplayStyle.None;

                switch (type)
                {
                case ControlBoxType.Close:
                    this.Click += new EventHandler(CloseItemHandler);
                    break;

                case ControlBoxType.Min:
                    this.Click += new EventHandler(MinimizeItemHandler);
                    break;

                case ControlBoxType.Max:
                    this.Click += new EventHandler(RestoreItemHandler);
                    break;
                }
            }
예제 #2
0
 /// <summary>Initializes a new instance of the <see cref="ControlBoxButton" /> class.</summary>
 public ControlBoxButton()
 {
     _backColorState = new ControlColorState();
     _boxType        = ControlBoxType.Default;
     _foreColorState = new ControlColorState();
     _image          = Resources.VisualPlus;
     MouseState      = MouseStates.Normal;
     _offsetLocation = new Point(0, 0);
 }
예제 #3
0
			public ControlBoxMenuItem (Form ownerForm, ControlBoxType type)
			{
				form = ownerForm;
				this.type = type;
				
				base.AutoSize = false;
				base.Alignment = ToolStripItemAlignment.Right;
				base.Size = new Size (20, 20);
				base.MergeIndex = int.MaxValue;
				base.DisplayStyle = ToolStripItemDisplayStyle.None;

				switch (type) {
					case ControlBoxType.Close:
						this.Click += new EventHandler(CloseItemHandler);
						break;
					case ControlBoxType.Min:
						this.Click += new EventHandler (MinimizeItemHandler);
						break;
					case ControlBoxType.Max:
						this.Click += new EventHandler (RestoreItemHandler);
						break;
				}
			}