G
garfitz
I am trying to create a custom control for a statusbar (set to red for erros etc..)
My test project has a blank form and a ColorStatusBar class.
Nothing is having an effect on the color of the statusbar!
Where am I going wrong ?
The ColorStatusBar class has the following code;
Public Class StatusBarRed
Inherits StatusBar
Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
Me.BackColor = Color.Blue
Me.ForeColor = Color.Red
MyBase.OnPaint(pe)
End Sub
End Class
My blank form has the following code after the initialize component section.
'Add any initialization after the InitializeComponent() call
Dim StatusBar1 As New ColourStatusBar.StatusBarRed
StatusBar1.Location = New System.Drawing.Point(0, 248)
StatusBar1.Size = New System.Drawing.Size(240, 22)
StatusBar1.Text = "StatusBar1"
Me.Controls.Add(StatusBar1)
My test project has a blank form and a ColorStatusBar class.
Nothing is having an effect on the color of the statusbar!
Where am I going wrong ?
The ColorStatusBar class has the following code;
Public Class StatusBarRed
Inherits StatusBar
Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
Me.BackColor = Color.Blue
Me.ForeColor = Color.Red
MyBase.OnPaint(pe)
End Sub
End Class
My blank form has the following code after the initialize component section.
'Add any initialization after the InitializeComponent() call
Dim StatusBar1 As New ColourStatusBar.StatusBarRed
StatusBar1.Location = New System.Drawing.Point(0, 248)
StatusBar1.Size = New System.Drawing.Size(240, 22)
StatusBar1.Text = "StatusBar1"
Me.Controls.Add(StatusBar1)