Hi
I am using the following code:
to loop through all the keys in a hash table. All the keys are the names of a valid combobox displayed on screen. What I am trying to do is to reflect the values chosen on the comboboxes on the parent screen through to the child screen. However, with the above code I am getting a NullReferenceException.
Any suggestions? I believe that the problem is that my code cannot find the control on the windows form.
Mike55.
I am using the following code:
Code:
Private Sub ReloadSelectionCriteria(ByVal userSelection As Hashtable)
For Each entry As DictionaryEntry In userSelection
CType(Controls(entry.Key), ComboBox).SelectedItem = entry.Value
Next
End Sub
to loop through all the keys in a hash table. All the keys are the names of a valid combobox displayed on screen. What I am trying to do is to reflect the values chosen on the comboboxes on the parent screen through to the child screen. However, with the above code I am getting a NullReferenceException.
Any suggestions? I believe that the problem is that my code cannot find the control on the windows form.
Mike55.