I have a User Control and when I try to put it on the Form in Design Mode it continuously loops between the UserControl_Paint event() and the Public Sub Redraw() event. This does not happen with my other UC which has the same two events in it. This looping causes the title bar of VB IDE to flicker over and over with the text ...Microsoft Visual Basic[running]
After executing the UserControl_Initialize() event and a few other things control then enters the Paint event and executes the Redraw call statement, enters the Redraw sub, executes the three statements there and returns to the Paint event which again calls the Redraw sub which continuous over and over.
UC Code:
After executing the UserControl_Initialize() event and a few other things control then enters the Paint event and executes the Redraw call statement, enters the Redraw sub, executes the three statements there and returns to the Paint event which again calls the Redraw sub which continuous over and over.
UC Code:
Code:
'
'
Private Sub UserControl_Paint()
Redraw
End Sub
Public Sub Redraw()
UserControl.MaskColor = UserControl.BackColor
Set UserControl.MaskPicture = UserControl.Image
UserControl.Refresh
End Sub
'
'