I'm developing a Windows application that will have an ListBar like in
Outlook. When the user clicks on a ListBar item, I would like to load the
associated User Control. The below code works fine, but I'm looking for
something more dynamic (since we'll have dozens if not hundreds of user
listbar items/user controls).
private void ulbListBar_ItemSelected(object sender,
Infragistics.Win.UltraWinListBar.ItemEventArgs e)
{
splContainer.Panel2.Controls.Clear();
switch (e.Item.Key)
{
case "keyTesting_CountryList":
uctTesting_CountryList _uctTesting_CountryList = new
uctTesting_CountryList();
splContainer.Panel2.Controls.Add(_uctTesting_Count ryList);
break;
case "keyTesting_StateList":
uctTesting_StateList _uctTesting_StateList = new
uctTesting_StateList();
splContainer.Panel2.Controls.Add(_uctTesting_State List);
break;
}
}
Thanks for any suggestions.
Ron