Created
September 20, 2013 04:01
-
-
Save Dave1235/6633144 to your computer and use it in GitHub Desktop.
When...Public lblDebug1 As New Label... is at the top of the form, the subroutine successfully creates and then removes the control. but it doesn't create it a second time. When...Dim lblDebug1 As New Label... is in the subroutine the dispose request doesn't work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim lblDebug1 As New Label | |
booleanDebug = Not booleanDebug 'A boolean that toggles True/False each time the sub is called | |
If booleanDebug Then | |
Me.Controls.Add(lblDebug1) 'These two commands are exicuted the first,third,fifth, ect time the sub is called | |
lblDebug1.BackColor = Color.BlueViolet | |
Else lblDebug1.Dispose() 'This command is exicuted the second, forth, sixth, ect time the sub is called | |
End If | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment