W
wavemill
Hello,
I would like herited of my button control and change my background.
I have try it, but my background is always grey.
Have you got an idea?
This is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ButtonControl
{
public partial class BeButton : System.Windows.Forms.Button
{
public BeButton()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
Brush myBrush = new SolidBrush(Color.Blue);
Rectangle destinationRect = new Rectangle(0, 0, this.Width,
this.Height);
e.Graphics.FillRectangle(myBrush, destinationRect);
base.OnPaint(e);
}
}
}
Thank you for your help,
wavemill
I would like herited of my button control and change my background.
I have try it, but my background is always grey.
Have you got an idea?
This is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ButtonControl
{
public partial class BeButton : System.Windows.Forms.Button
{
public BeButton()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
Brush myBrush = new SolidBrush(Color.Blue);
Rectangle destinationRect = new Rectangle(0, 0, this.Width,
this.Height);
e.Graphics.FillRectangle(myBrush, destinationRect);
base.OnPaint(e);
}
}
}
Thank you for your help,
wavemill