Hey,
You do know what it is, as you have just checked the type of the Control that is being passed through, so you can cast it to that type:
Or am I missing something?Code:For i As Integer = 1 To NumOfDays If TypeOf pctrlWhatControl Is ListBox Then Dim tempListBox As ListBox = DirectCast(pctrlWhatControl, ListBox) tempListBox.Items.Add() ElseIf TypeOf pctrlWhatControl Is ComboBox Then Dim temComboBox As ComboBox = DirectCast(pctrlWhatControl, ComboBox) temComboBox.Items.Add() End If Next
Gary





Reply With Quote