Is there a way to get an object by name?
I have tabs that are identical except for how they are used.
So I have a list box on each tab named by function: lbSelectName, lbInsertName, lbUpdataName, e.t.c.
I also know which tab I am on by enums: Select, Insert Update, e.t.c.
Is there a way to get object (ListBox, TextBox, CheckedListBox) by name that I can than pass to a method that only knows the type of object?
So I would do something like:
Thanks,
Tom
I have tabs that are identical except for how they are used.
So I have a list box on each tab named by function: lbSelectName, lbInsertName, lbUpdataName, e.t.c.
I also know which tab I am on by enums: Select, Insert Update, e.t.c.
Is there a way to get object (ListBox, TextBox, CheckedListBox) by name that I can than pass to a method that only knows the type of object?
So I would do something like:
Code:
ListBox lb;
switch(mode)
{
case enum.Select:
lb = findcontrol("lbSelectName");
break;
case enum.Insert:
lb = findcontrol("lbInsertName");
break;
case enum.Update:
lb = findcontrol("lbUpdateName");
break;
}
ProcessSave(lb);
Thanks,
Tom