protected override void OnMouseLeave(EventArgs e) { if (Checked) { switch (CheckState) { case CheckStates.Checked: Bmp = ResClass.GetImgRes("cb_c_l"); break; case CheckStates.Indeterminate: Bmp = ResClass.GetImgRes("cb_b_l"); break; default: Bmp = ResClass.GetImgRes("cb_c_l"); break; } } else { Bmp = ResClass.GetImgRes("cb_n_l"); } this.Invalidate(new Rectangle(0, (Height - 15) / 2, 15, 15)); }
private void bar_MouseDown(object sender, MouseEventArgs e) { barMove = true; oldPoint = MousePosition; bar_Bmp = ResClass.GetImgRes("scrollbar_bar_down"); this.Invalidate(); }
public BasicCheckBox() { if (Checked) { switch (CheckState) { case CheckStates.Checked: Bmp = ResClass.GetImgRes("cb_c_l"); break; case CheckStates.Indeterminate: Bmp = ResClass.GetImgRes("cb_b_l"); break; default: Bmp = ResClass.GetImgRes("cb_c_l"); break; } } else { Bmp = ResClass.GetImgRes("cb_n_l"); } this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.BackColor = Color.Transparent; this.Size = new Size(95, 20); }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); g = e.Graphics; if (Bmp == null) { Bmp = ResClass.GetImgRes("frameBorderEffect_normalDraw"); } if (Bmp != null) { g.DrawImage(Bmp, new Rectangle(0, 0, 4, 4), 0, 0, 4, 4, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(4, 0, this.Width - 8, 4), 4, 0, Bmp.Width - 8, 4, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(this.Width - 4, 0, 4, 4), Bmp.Width - 4, 0, 4, 4, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(0, 4, 4, this.Height - 6), 0, 4, 4, Bmp.Height - 8, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(this.Width - 4, 4, 4, this.Height - 6), Bmp.Width - 4, 4, 4, Bmp.Height - 6, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(0, this.Height - 2, 2, 2), 0, Bmp.Height - 2, 2, 2, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(2, this.Height - 2, this.Width - 2, 2), 2, Bmp.Height - 2, Bmp.Width - 4, 2, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(this.Width - 2, this.Height - 2, 2, 2), Bmp.Width - 2, Bmp.Height - 2, 2, 2, GraphicsUnit.Pixel); } if (Icon != null) { g.DrawImage(Icon, new Rectangle(1, 1, Bmp.Width, Bmp.Height), 0, 0, Bmp.Width, Bmp.Height, GraphicsUnit.Pixel); } }
protected override void OnPaintBackground(PaintEventArgs e) { base.OnPaintBackground(e); g = e.Graphics; Bmp = ResClass.GetImgRes("scrollbar_bkg"); g.DrawImage(Bmp, new Rectangle(0, 0, Width, Height), 0, 0, Bmp.Width, Bmp.Height - 1, GraphicsUnit.Pixel); }
public VScrollControl() { this.Width = 14; this.Height = 60; bar_Bmp = ResClass.GetImgRes("scrollbar_bar_normal"); InitControl(); }
public BasicButton() { this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); InitializeComponent(); Bmp = ResClass.GetImgRes("btn_normal"); }
private void btn_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { ((PictureBox)sender).BackgroundImage = ResClass.GetImgRes("allbtn_down"); } }
private void btn_MouseEnter(object sender, EventArgs e) { g = ((PictureBox)sender).CreateGraphics(); Bmp = ResClass.GetImgRes("allbtn_highlight"); g.DrawImage(Bmp, new Rectangle(0, 0, 22, 22), 0, 0, 22, 22, GraphicsUnit.Pixel); Bmp.Dispose(); g.Dispose(); }
private void ButtonClose_MouseUp(object sender, MouseEventArgs e) { if (!ButtonClose.IsDisposed) { closeBmp = ResClass.GetImgRes("btn_close_normal"); ButtonClose.Invalidate(); } }
public QQComboBoxItem() { this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.BackColor = Color.White; bmp1 = ResClass.GetImgRes("mune_select_bkg"); }
protected override void OnMouseEnter(EventArgs e) { if (!showed) { bmp = ResClass.GetImgRes("frameBorderEffect_mouseDownDraw"); img = ResClass.GetImgRes("login_inputbtn_highlight"); this.Invalidate(); } }
protected override void OnMouseLeave(EventArgs e) { if (!showed) { bmp = ResClass.GetImgRes("frameBorderEffect_normalDraw"); img = ResClass.GetImgRes("combobox_buttonNormalDraw"); this.Invalidate(); } }
protected override void OnMouseEnter(EventArgs e) { if (!showed) { bmp = ResClass.GetImgRes("frameBorderEffect_mouseDownDraw"); img = ResClass.GetImgRes("combobox_buttonHighlightDraw"); this.Invalidate(); } }
private void ButtonMax_MouseUp(object sender, MouseEventArgs e) { maxBmp = ResClass.GetImgRes("btn_max_normal"); if (this.WindowState == FormWindowState.Maximized) { maxBmp = ResClass.GetImgRes("btn_restore_normal"); } ButtonMax.Invalidate(); }
protected override void OnMouseLeave(EventArgs e) { if (!showed) { bmp = ResClass.GetImgRes("frameBorderEffect_normalDraw"); img = ResClass.GetImgRes("login_inputbtn_normal"); this.Invalidate(); } }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); Bmp = ResClass.GetImgRes("login_btn_normal"); if (this.Focused) { Bmp = ResClass.GetImgRes("login_btn_focus"); } this.Invalidate(); }
public BasicQQTextBox() { this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); Bmp = ResClass.GetImgRes("frameBorderEffect_normalDraw"); Icon = ResClass.GetImgRes("keyboard"); InitializeComponent(); }
public BasicTextBox() { InitTextBox(); bmp = ResClass.GetImgRes("frameBorderEffect_normalDraw"); this.BackColor = System.Drawing.Color.Transparent; this.Size = new Size(150, 22); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); }
private void ButtonMax_MouseDown(object sender, MouseEventArgs e) { g = ButtonMax.CreateGraphics(); maxBmp = ResClass.GetImgRes("btn_max_down"); if (this.WindowState == FormWindowState.Maximized) { maxBmp = ResClass.GetImgRes("btn_restore_down"); } g.DrawImage(maxBmp, new Rectangle(0, 0, maxBmp.Width, maxBmp.Height), 0, 0, maxBmp.Width, maxBmp.Height, GraphicsUnit.Pixel); }
private void InitControl() { MaximumSize = Screen.PrimaryScreen.WorkingArea.Size; closeBmp = ResClass.GetImgRes("btn_close_normal"); minBmp = ResClass.GetImgRes("btn_mini_normal"); maxBmp = ResClass.GetImgRes("btn_max_normal"); if (this.WindowState == FormWindowState.Maximized) { maxBmp = ResClass.GetImgRes("btn_restore_normal"); } }
public QQComboBox() { bmp = ResClass.GetImgRes("frameBorderEffect_normalDraw"); img = ResClass.GetImgRes("login_inputbtn_normal"); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); InitializeComponent(); textBox1.Text = Texts; }
private Bitmap GetImg(string ImgName, int width, int height, int sleft, int stop, int sWidth, int sHeight) { Image srcImg = ResClass.GetImgRes(ImgName); Bitmap newImg = new Bitmap(width, height); Graphics graphics = Graphics.FromImage(newImg); graphics.DrawImage(srcImg, new Rectangle(0, 0, width, height), (sleft < 0 ? srcImg.Width + sleft : sleft), (stop < 0 ? srcImg.Height + stop : stop), (sWidth < 0 ? srcImg.Width + sWidth : sWidth), (sHeight < 0 ? srcImg.Height + sHeight : sHeight), GraphicsUnit.Pixel); graphics.Dispose(); srcImg.Dispose(); return newImg; }
private void con_MouseEnter(object sender, EventArgs e) { Control label = ((Control)sender); g = ((Control)sender).CreateGraphics(); Bmp = ResClass.GetImgRes("allbtn_highlight"); g.DrawImage(Bmp, new Rectangle(0, 0, 2, label.Height), 0, 0, 2, Bmp.Height, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(2, 0, label.Width - 5, label.Height), 2, 0, Bmp.Width - 5, Bmp.Height, GraphicsUnit.Pixel); g.DrawImage(Bmp, new Rectangle(label.Width - 3, 0, 3, label.Height), Bmp.Width - 3, 0, 3, Bmp.Height, GraphicsUnit.Pixel); Bmp.Dispose(); g.Dispose(); }
private void ButtonMax_MouseEnter(object sender, EventArgs e) { g = ButtonMax.CreateGraphics(); maxBmp = ResClass.GetImgRes("btn_max_highlight"); toolTip1.SetToolTip(ButtonMax, "最大化"); if (this.WindowState == FormWindowState.Maximized) { maxBmp = ResClass.GetImgRes("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); }
protected override void OnMouseEnter(EventArgs e) { if (m_Checked) { Bmp = ResClass.GetImgRes("rb_click_move"); } else { Bmp = ResClass.GetImgRes("rb_no_move"); } this.Invalidate(); }
protected override void OnMouseLeave(EventArgs e) { if (Focused) { Bmp = ResClass.GetImgRes("btn_focus"); } else { Bmp = ResClass.GetImgRes("btn_normal"); } this.Invalidate(); }
private void ButtonMax_Paint(object sender, PaintEventArgs e) { if (this.MaximizeBox) { g = e.Graphics; maxBmp = ResClass.GetImgRes("btn_max_normal"); if (this.WindowState == FormWindowState.Maximized) { maxBmp = ResClass.GetImgRes("btn_restore_normal"); } g.DrawImage(maxBmp, new Rectangle(0, 0, maxBmp.Width, maxBmp.Height), 0, 0, maxBmp.Width, maxBmp.Height, GraphicsUnit.Pixel); } }
private void arrow_MouseEnter(object sender, EventArgs e) { PictureBox p = sender as PictureBox; if (p.Name == "arrowup") { p.Image = ResClass.GetImgRes("scrollbar_arrowup_highlight"); } else { p.Image = ResClass.GetImgRes("scrollbar_arrowdown_highlight"); } }
public LoginButton() { Bmp = ResClass.GetImgRes("login_btn_normal"); if (this.Focused) { Bmp = ResClass.GetImgRes("login_btn_focus"); } this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.BackColor = Color.Transparent; this.Size = new Size(74, 27); }