M
Mick Doherty
Minimal Code and steps needed to show problem.
Inherit from Button and set Region as below.
\\\
Protected Overrides Sub OnPaint(ByVal pevent as PaintEventArgs)
MyBase.OnPaint(pevent)
Me.Region = New Region(New Rectangle(5, 5, Width - 10, Height - 10))
End Sub
///
Add several of the inherited buttons to your form, set the forms
startposition to centerscreen and run the project. Place the mouse over any
one of the buttons you added to the form except the first one and press
Alt-F4 to close the form. Press F5 to start the project. All of the
inherited buttons added to the form before the one the mouse is over do not
get painted until after the mouse moves outside that buttons region.
The above steps were only necessary to make sure the mouse was over one of
the inherited buttons at startup.
Inherit from Button and set Region as below.
\\\
Protected Overrides Sub OnPaint(ByVal pevent as PaintEventArgs)
MyBase.OnPaint(pevent)
Me.Region = New Region(New Rectangle(5, 5, Width - 10, Height - 10))
End Sub
///
Add several of the inherited buttons to your form, set the forms
startposition to centerscreen and run the project. Place the mouse over any
one of the buttons you added to the form except the first one and press
Alt-F4 to close the form. Press F5 to start the project. All of the
inherited buttons added to the form before the one the mouse is over do not
get painted until after the mouse moves outside that buttons region.
The above steps were only necessary to make sure the mouse was over one of
the inherited buttons at startup.