R
Ronald S. Cook
I lost my last post, but I'm looking for a better way to manage loading user
controls (that are essentially forms) in a Windows app.
In my current design, I have a ListBar in which the user selects an item. I
then call a sub to loop through and remove any user control that may exist
in the panel. But then I have a wordy select statement to load up the user
control selected.
Isn't there a better way?
Thanks,
Ron
Private Sub ulbNav_ItemSelected(ByVal sender As System.Object, ByVal e As
Infragistics.Win.UltraWinListBar.ItemEventArgs) Handles ulbNav.ItemSelected
RemoveExitingUserControls()
Select Case e.Item.Key
Case "keyTesting_ViewCountryList"
If _uctTesting_ViewCountryList Is Nothing Then
_uctTesting_ViewCountryList = New uctTesting_ViewCountryList
_uctTesting_ViewCountryList.Parent = splContainer.Panel2
End If
Case "keyTesting_SQLReportViewer"
If _uctTesting_SQLReportViewer Is Nothing Then
_uctTesting_SQLReportViewer = New uctTesting_SQLReportViewer
_uctTesting_SQLReportViewer.Parent = splContainer.Panel2
End If
Case "keyTesting_CalculateDrivingDistance"
If _uctTesting_CalculateDrivingDistance Is Nothing Then
_uctTesting_CalculateDrivingDistance = New
uctTesting_CalculateDrivingDistance
_uctTesting_CalculateDrivingDistance.Parent = splContainer.Panel2
End If
End Select
End Sub
controls (that are essentially forms) in a Windows app.
In my current design, I have a ListBar in which the user selects an item. I
then call a sub to loop through and remove any user control that may exist
in the panel. But then I have a wordy select statement to load up the user
control selected.
Isn't there a better way?
Thanks,
Ron
Private Sub ulbNav_ItemSelected(ByVal sender As System.Object, ByVal e As
Infragistics.Win.UltraWinListBar.ItemEventArgs) Handles ulbNav.ItemSelected
RemoveExitingUserControls()
Select Case e.Item.Key
Case "keyTesting_ViewCountryList"
If _uctTesting_ViewCountryList Is Nothing Then
_uctTesting_ViewCountryList = New uctTesting_ViewCountryList
_uctTesting_ViewCountryList.Parent = splContainer.Panel2
End If
Case "keyTesting_SQLReportViewer"
If _uctTesting_SQLReportViewer Is Nothing Then
_uctTesting_SQLReportViewer = New uctTesting_SQLReportViewer
_uctTesting_SQLReportViewer.Parent = splContainer.Panel2
End If
Case "keyTesting_CalculateDrivingDistance"
If _uctTesting_CalculateDrivingDistance Is Nothing Then
_uctTesting_CalculateDrivingDistance = New
uctTesting_CalculateDrivingDistance
_uctTesting_CalculateDrivingDistance.Parent = splContainer.Panel2
End If
End Select
End Sub