Exemplo n.º 1
0
 private void ButtonClose_MouseUp(object sender, MouseEventArgs e)
 {
     if (!ButtonClose.IsDisposed)
     {
         closeBmp = ResClass.GetResObj("btn_close_normal");
         ButtonClose.Invalidate();
     }
 }
Exemplo n.º 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();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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");
     }
 }
Exemplo n.º 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);
 }
Exemplo n.º 8
0
 private void ButtonMin_MouseLeave(object sender, EventArgs e)
 {
     minBmp = ResClass.GetResObj("btn_mini_normal");
     ButtonMin.Invalidate();
 }
Exemplo n.º 9
0
 private void ButtonMin_MouseUp(object sender, MouseEventArgs e)
 {
     minBmp = ResClass.GetResObj("btn_close_normal");
     ButtonMin.Invalidate();
 }
Exemplo n.º 10
0
 private void ButtonMin_MouseDown(object sender, MouseEventArgs e)
 {
     minBmp = ResClass.GetResObj("btn_mini_down");
     ButtonMin.Invalidate();
 }
Exemplo n.º 11
0
 private void ButtonMin_MouseEnter(object sender, EventArgs e)
 {
     minBmp = ResClass.GetResObj("btn_mini_highlight");
     toolTip1.SetToolTip(ButtonMin, "最小化");
     ButtonMin.Invalidate();
 }
Exemplo n.º 12
0
 private void ButtonClose_MouseEnter(object sender, EventArgs e)
 {
     closeBmp = ResClass.GetResObj("btn_close_highlight");
     toolTip1.SetToolTip(ButtonClose, "关闭");
     ButtonClose.Invalidate();
 }
Exemplo n.º 13
0
 private void ButtonClose_MouseLeave(object sender, EventArgs e)
 {
     closeBmp = ResClass.GetResObj("btn_close_normal");
     ButtonClose.Invalidate();
 }
Exemplo n.º 14
0
 private void ButtonClose_MouseDown(object sender, MouseEventArgs e)
 {
     closeBmp = ResClass.GetResObj("btn_close_down");
     ButtonClose.Invalidate();
 }