public Windows31Form() { // set control styles: this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true ); InitializeComponent(); panel = new Panel(); this.panel.Location = new System.Drawing.Point(4, 4); this.panel.Size = new System.Drawing.Size(ClientSize.Width - 8, 19); this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panel.BackColor = System.Drawing.Color.Navy; this.panel.DoubleClick += Panel_DoubleClick; this.panel.MouseDoubleClick += Panel_MouseDoubleClick; this.Controls.Add(panel); panel.Paint += Panel_Paint; panel.MouseDown += Panel_MouseDown; RetroButton retroMenu = new RetroButton(); retroMenu.Size = new Size(20, 20); retroMenu.Type = ButtonType.System; retroMenu.Symbol = SystemSymbol.SystemOptions; //retro1.Location = new Point(0, 200); retroMenu.Location = new Point(-1, -1); //retro1.Dock = DockStyle.Right; RetroButton upButton = new RetroButton(); upButton.Size = new Size(20, 20); upButton.Text = "t"; upButton.Type = ButtonType.System; upButton.Symbol = SystemSymbol.Up; upButton.Click += upButton_Click; //retro1.Location = new Point(0, 200); upButton.Location = new Point(panel.Width - upButton.Width + 1, -1); upButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)))); //retro1.Dock = DockStyle.Right; RetroButton downButton = new RetroButton(); downButton.Size = new Size(20, 20); downButton.Text = "i"; //retro2.Dock = DockStyle.Right; downButton.Type = ButtonType.System; downButton.Symbol = SystemSymbol.Down; downButton.Click += downButton_Click; downButton.Location = new Point(panel.Width - upButton.Width - downButton.Width + 2, -1); downButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)))); panel.Controls.Add(retroMenu); panel.Controls.Add(upButton); panel.Controls.Add(downButton); }
private void InitializeComponent() { this.pnlTitle = new System.Windows.Forms.Panel(); this.retroButton1 = new WindowsRetro.RetroButton(); this.btnMaximize = new WindowsRetro.RetroButton(); this.btnMinimize = new WindowsRetro.RetroButton(); this.pnlTitle.SuspendLayout(); this.SuspendLayout(); // // pnlTitle // this.pnlTitle.BackColor = System.Drawing.Color.Navy; this.pnlTitle.Controls.Add(this.btnMinimize); this.pnlTitle.Controls.Add(this.retroButton1); this.pnlTitle.Controls.Add(this.btnMaximize); this.pnlTitle.Dock = System.Windows.Forms.DockStyle.Top; this.pnlTitle.Location = new System.Drawing.Point(4, 4); this.pnlTitle.Name = "pnlTitle"; this.pnlTitle.Size = new System.Drawing.Size(392, 19); this.pnlTitle.TabIndex = 0; this.pnlTitle.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlTitle_Paint); this.pnlTitle.DoubleClick += new System.EventHandler(this.pnlTitle_DoubleClick); this.pnlTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlTitle_MouseDown); this.pnlTitle.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlTitle_MouseMove); this.pnlTitle.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlTitle_MouseUp); // // retroButton1 // this.retroButton1.Location = new System.Drawing.Point(-1, -1); this.retroButton1.Name = "retroButton1"; this.retroButton1.Size = new System.Drawing.Size(20, 20); this.retroButton1.Symbol = WindowsRetro.SystemSymbol.SystemOptions; this.retroButton1.TabIndex = 1; this.retroButton1.Text = "retroButton1"; this.retroButton1.Type = WindowsRetro.ButtonType.System; // // btnMaximize // this.btnMaximize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnMaximize.Location = new System.Drawing.Point(373, -1); this.btnMaximize.Name = "btnMaximize"; this.btnMaximize.Size = new System.Drawing.Size(20, 20); this.btnMaximize.Symbol = WindowsRetro.SystemSymbol.Up; this.btnMaximize.TabIndex = 2; this.btnMaximize.Text = "retroButton2"; this.btnMaximize.Type = WindowsRetro.ButtonType.System; this.btnMaximize.Click += new System.EventHandler(this.btnMaximize_Click); // // btnMinimize // this.btnMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnMinimize.Location = new System.Drawing.Point(354, -1); this.btnMinimize.Name = "btnMinimize"; this.btnMinimize.Size = new System.Drawing.Size(20, 20); this.btnMinimize.Symbol = WindowsRetro.SystemSymbol.Down; this.btnMinimize.TabIndex = 3; this.btnMinimize.Text = "retroButton3"; this.btnMinimize.Type = WindowsRetro.ButtonType.System; this.btnMinimize.Click += new System.EventHandler(this.btnMinimize_Click); // // W31Form // this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(400, 264); this.Controls.Add(this.pnlTitle); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "W31Form"; this.Padding = new System.Windows.Forms.Padding(4); this.pnlTitle.ResumeLayout(false); this.ResumeLayout(false); }