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_ItemSele cted(ByVal sender As System.Object, ByVal e As
Infragistics.Wi n.UltraWinListB ar.ItemEventArg s) Handles ulbNav.ItemSele cted
RemoveExitingUs erControls()
Select Case e.Item.Key
Case "keyTesting_Vie wCountryList"
If _uctTesting_Vie wCountryList Is Nothing Then
_uctTesting_Vie wCountryList = New uctTesting_View CountryList
_uctTesting_Vie wCountryList.Pa rent = splContainer.Pa nel2
End If
Case "keyTesting_SQL ReportViewer"
If _uctTesting_SQL ReportViewer Is Nothing Then
_uctTesting_SQL ReportViewer = New uctTesting_SQLR eportViewer
_uctTesting_SQL ReportViewer.Pa rent = splContainer.Pa nel2
End If
Case "keyTesting_Cal culateDrivingDi stance"
If _uctTesting_Cal culateDrivingDi stance Is Nothing Then
_uctTesting_Cal culateDrivingDi stance = New
uctTesting_Calc ulateDrivingDis tance
_uctTesting_Cal culateDrivingDi stance.Parent = splContainer.Pa nel2
End If
End Select
End Sub