Derek Hart
2009-09-21 22:01:48 UTC
If I have code like the following, and I want to send in two different types
for uc, and they both have the exact same named controls insie them, how
would I do this? I cannot use uc.MyCombobox1 because uc is just a generic
user control.
Private Sub VaultFillComboBoxes(ByVal uc As UserControl)
With uc.MyCombobox1
.Items.Add("Personal")
.Items.Add("Business")
.Items.Add("Tax")
End With
I need to be able to do the following:
If TypeOf uc is uc1 then...
If TypeOf uc is uc2 then...
So then I can just use one line of code and not have to duplicate the entire
procedure twice.
With uc.MyCombobox1
for uc, and they both have the exact same named controls insie them, how
would I do this? I cannot use uc.MyCombobox1 because uc is just a generic
user control.
Private Sub VaultFillComboBoxes(ByVal uc As UserControl)
With uc.MyCombobox1
.Items.Add("Personal")
.Items.Add("Business")
.Items.Add("Tax")
End With
I need to be able to do the following:
If TypeOf uc is uc1 then...
If TypeOf uc is uc2 then...
So then I can just use one line of code and not have to duplicate the entire
procedure twice.
With uc.MyCombobox1