Hi moondaddy,
Sorry for letting you wait for so long.
To change the backcolor of the statusbar, we should do the custom drawing
ourselves. Note that, when we decided to do the custom drawing, we have to
handle the painting of the whole area of statusbar, and the setting in
statusbarpanel will take no effect, so if you need statusbarpanel, we
should paint it ourselves either.
The way of openning custom painting is overriding the statusbar class and
use Control.SetStyle to add ControlStyles.UserPaint bit to statusbar
control. Code snippet lists below:
public class MyStatusBar : System.Windows.Forms.StatusBar
{
public MyStatusBar()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint,
true);
this.UpdateStyles();
}
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, this.Width,
this.Height);
e.Graphics.DrawString("customized drawing", new Font("Arial", 10), new
SolidBrush(Color.Red), this.ClientRectangle, new StringFormat());
ControlPaint.DrawBorder(e.Graphics, 0, 0, this.Width, this.Height);
base.OnPaint (e);
}
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.