Skip to content

Instantly share code, notes, and snippets.

@Dave1235
Created September 20, 2013 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dave1235/6633144 to your computer and use it in GitHub Desktop.
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
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