M
moondaddy
I have a user control on a form and when I close the form.
This is the first event that fires:
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
Then when this line executes the controls Dispose event fires.
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Now when the line in this event executes:
(components.Dispose())...
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
The controls load event fires which then executes a bunch of code like
populating controls with data which I don't want since its closing. It this
correct behavior and what's a good way to trap it in the load event?
Thanks.
This is the first event that fires:
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
Then when this line executes the controls Dispose event fires.
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Now when the line in this event executes:
(components.Dispose())...
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
The controls load event fires which then executes a bunch of code like
populating controls with data which I don't want since its closing. It this
correct behavior and what's a good way to trap it in the load event?
Thanks.