示例#1
0
        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));
        }
示例#2
0
 private void bar_MouseDown(object sender, MouseEventArgs e)
 {
     barMove  = true;
     oldPoint = MousePosition;
     bar_Bmp  = ResClass.GetImgRes("scrollbar_bar_down");
     this.Invalidate();
 }
示例#3
0
        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);
        }
示例#4
0
        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);
            }
        }
示例#5
0
 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);
 }
示例#6
0
 public VScrollControl()
 {
     this.Width  = 14;
     this.Height = 60;
     bar_Bmp     = ResClass.GetImgRes("scrollbar_bar_normal");
     InitControl();
 }
示例#7
0
 public BasicButton()
 {
     this.SetStyle(ControlStyles.UserPaint, true);
     this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); InitializeComponent();
     Bmp = ResClass.GetImgRes("btn_normal");
 }
示例#8
0
 private void btn_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         ((PictureBox)sender).BackgroundImage = ResClass.GetImgRes("allbtn_down");
     }
 }
示例#9
0
 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();
 }
示例#10
0
 private void ButtonClose_MouseUp(object sender, MouseEventArgs e)
 {
     if (!ButtonClose.IsDisposed)
     {
         closeBmp = ResClass.GetImgRes("btn_close_normal");
         ButtonClose.Invalidate();
     }
 }
示例#11
0
 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");
 }
示例#12
0
 protected override void OnMouseEnter(EventArgs e)
 {
     if (!showed)
     {
         bmp = ResClass.GetImgRes("frameBorderEffect_mouseDownDraw");
         img = ResClass.GetImgRes("login_inputbtn_highlight");
         this.Invalidate();
     }
 }
示例#13
0
 protected override void OnMouseLeave(EventArgs e)
 {
     if (!showed)
     {
         bmp = ResClass.GetImgRes("frameBorderEffect_normalDraw");
         img = ResClass.GetImgRes("combobox_buttonNormalDraw");
         this.Invalidate();
     }
 }
示例#14
0
 protected override void OnMouseEnter(EventArgs e)
 {
     if (!showed)
     {
         bmp = ResClass.GetImgRes("frameBorderEffect_mouseDownDraw");
         img = ResClass.GetImgRes("combobox_buttonHighlightDraw");
         this.Invalidate();
     }
 }
示例#15
0
 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();
 }
示例#16
0
 protected override void OnMouseLeave(EventArgs e)
 {
     if (!showed)
     {
         bmp = ResClass.GetImgRes("frameBorderEffect_normalDraw");
         img = ResClass.GetImgRes("login_inputbtn_normal");
         this.Invalidate();
     }
 }
示例#17
0
 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();
 }
示例#18
0
 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();
 }
示例#19
0
 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);
 }
示例#20
0
 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);
 }
示例#21
0
 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");
     }
 }
示例#22
0
 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;
 }
示例#23
0
        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;
        }
示例#24
0
        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();
        }
示例#25
0
 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);
 }
示例#26
0
 protected override void OnMouseEnter(EventArgs e)
 {
     if (m_Checked)
     {
         Bmp = ResClass.GetImgRes("rb_click_move");
     }
     else
     {
         Bmp = ResClass.GetImgRes("rb_no_move");
     }
     this.Invalidate();
 }
示例#27
0
 protected override void OnMouseLeave(EventArgs e)
 {
     if (Focused)
     {
         Bmp = ResClass.GetImgRes("btn_focus");
     }
     else
     {
         Bmp = ResClass.GetImgRes("btn_normal");
     }
     this.Invalidate();
 }
示例#28
0
 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);
     }
 }
示例#29
0
        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");
            }
        }
示例#30
0
 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);
 }