コード例 #1
0
 private void ButtonClose_MouseUp(object sender, MouseEventArgs e)
 {
     if (!ButtonClose.IsDisposed)
     {
         closeBmp = ResClass.GetResObj("btn_close_normal");
         ButtonClose.Invalidate();
     }
 }
コード例 #2
0
 private void ButtonMax_MouseUp(object sender, MouseEventArgs e)
 {
     maxBmp = ResClass.GetResObj("btn_max_normal");
     if (this.WindowState == FormWindowState.Maximized)
     {
         maxBmp = ResClass.GetResObj("btn_restore_normal");
     }
     ButtonMax.Invalidate();
 }
コード例 #3
0
 private void ButtonMax_MouseDown(object sender, MouseEventArgs e)
 {
     g      = ButtonMax.CreateGraphics();
     maxBmp = ResClass.GetResObj("btn_max_down");
     if (this.WindowState == FormWindowState.Maximized)
     {
         maxBmp = ResClass.GetResObj("btn_restore_down");
     }
     g.DrawImage(maxBmp, new Rectangle(0, 0, maxBmp.Width, maxBmp.Height), 0, 0, maxBmp.Width, maxBmp.Height, GraphicsUnit.Pixel);
 }
コード例 #4
0
 private void ButtonMax_MouseEnter(object sender, EventArgs e)
 {
     g      = ButtonMax.CreateGraphics();
     maxBmp = ResClass.GetResObj("btn_max_highlight");
     toolTip1.SetToolTip(ButtonMax, "最大化");
     if (this.WindowState == FormWindowState.Maximized)
     {
         maxBmp = ResClass.GetResObj("btn_restore_highlight");
         toolTip1.SetToolTip(ButtonMax, "还原");
     }
     g.DrawImage(maxBmp, new Rectangle(0, 0, maxBmp.Width, maxBmp.Height), 0, 0, maxBmp.Width, maxBmp.Height, GraphicsUnit.Pixel);
 }
コード例 #5
0
 private void ButtonMax_Paint(object sender, PaintEventArgs e)
 {
     if (this.MaximizeBox)
     {
         g      = e.Graphics;
         maxBmp = ResClass.GetResObj("btn_max_normal");
         if (this.WindowState == FormWindowState.Maximized)
         {
             maxBmp = ResClass.GetResObj("btn_restore_normal");
         }
         g.DrawImage(maxBmp, new Rectangle(0, 0, maxBmp.Width, maxBmp.Height), 0, 0, maxBmp.Width, maxBmp.Height, GraphicsUnit.Pixel);
     }
 }
コード例 #6
0
 public BasicForm()
 {
     this.SetStyle(ControlStyles.UserPaint, true);
     this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     InitializeComponent();
     this.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;
     closeBmp         = ResClass.GetResObj("btn_close_normal");
     minBmp           = ResClass.GetResObj("btn_mini_normal");
     maxBmp           = ResClass.GetResObj("btn_max_normal");
     if (this.WindowState == FormWindowState.Maximized)
     {
         maxBmp = ResClass.GetResObj("btn_restore_normal");
     }
 }
コード例 #7
0
 protected override void OnPaint(PaintEventArgs e)
 {
     g         = e.Graphics;
     Bmp       = ResClass.GetResObj("window");
     Bmp       = (Bitmap)Util.ProcImage(Bmp, colorA, grayC, lightB);
     imageAttr = new ImageAttributes();
     imageAttr.SetColorKey(Bmp.GetPixel(1, 1), Bmp.GetPixel(1, 1));
     g.DrawImage(Bmp, new Rectangle(1, 1, 5, 31), 0, 0, 5, 31, GraphicsUnit.Pixel);
     g.DrawImage(Bmp, new Rectangle(6, 1, this.Width - 12, 31), 5, 0, Bmp.Width - 10, 31, GraphicsUnit.Pixel);
     g.DrawImage(Bmp, new Rectangle(this.Width - 6, 1, 5, 31), Bmp.Width - 5, 0, 5, 31, GraphicsUnit.Pixel);
     g.DrawImage(Bmp, new Rectangle(1, 32, 5, this.Height - 38), 0, 31, 5, Bmp.Height - 36, GraphicsUnit.Pixel);
     g.DrawImage(Bmp, new Rectangle(6, 32, this.Width - 10, this.Height - 38), 5, 31, 5, Bmp.Height - 36, GraphicsUnit.Pixel);
     g.DrawImage(Bmp, new Rectangle(this.Width - 6, 32, 5, this.Height - 38), Bmp.Width - 5, 31, 5, Bmp.Height - 36, GraphicsUnit.Pixel);
     g.DrawImage(Bmp, new Rectangle(1, this.Height - 6, 5, 5), 0, Bmp.Height - 5, 5, 5, GraphicsUnit.Pixel);
     g.DrawImage(Bmp, new Rectangle(6, this.Height - 6, this.Width - 12, 5), 5, Bmp.Height - 5, Bmp.Width - 10, 5, GraphicsUnit.Pixel);
     g.DrawImage(Bmp, new Rectangle(this.Width - 6, this.Height - 6, 5, 5), Bmp.Width - 5, Bmp.Height - 5, 5, 5, GraphicsUnit.Pixel);
     //g.DrawImage(closeBmp, new Rectangle(this.Width - closeBmp.Width-1, 0, closeBmp.Width, closeBmp.Height), 0, 0, closeBmp.Width, closeBmp.Height, GraphicsUnit.Pixel);
     g.DrawIcon(this.Icon, new Rectangle(7, 7, 18, 18));
     g.DrawString(this.Text, new Font("微软雅黑", 10F, FontStyle.Bold), titleColor, 26, 7);
 }
コード例 #8
0
 private void ButtonMin_MouseLeave(object sender, EventArgs e)
 {
     minBmp = ResClass.GetResObj("btn_mini_normal");
     ButtonMin.Invalidate();
 }
コード例 #9
0
 private void ButtonMin_MouseUp(object sender, MouseEventArgs e)
 {
     minBmp = ResClass.GetResObj("btn_close_normal");
     ButtonMin.Invalidate();
 }
コード例 #10
0
 private void ButtonMin_MouseDown(object sender, MouseEventArgs e)
 {
     minBmp = ResClass.GetResObj("btn_mini_down");
     ButtonMin.Invalidate();
 }
コード例 #11
0
 private void ButtonMin_MouseEnter(object sender, EventArgs e)
 {
     minBmp = ResClass.GetResObj("btn_mini_highlight");
     toolTip1.SetToolTip(ButtonMin, "最小化");
     ButtonMin.Invalidate();
 }
コード例 #12
0
 private void ButtonClose_MouseEnter(object sender, EventArgs e)
 {
     closeBmp = ResClass.GetResObj("btn_close_highlight");
     toolTip1.SetToolTip(ButtonClose, "关闭");
     ButtonClose.Invalidate();
 }
コード例 #13
0
 private void ButtonClose_MouseLeave(object sender, EventArgs e)
 {
     closeBmp = ResClass.GetResObj("btn_close_normal");
     ButtonClose.Invalidate();
 }
コード例 #14
0
 private void ButtonClose_MouseDown(object sender, MouseEventArgs e)
 {
     closeBmp = ResClass.GetResObj("btn_close_down");
     ButtonClose.Invalidate();
 }