7
Answers

Getting the value from a combobox

Scott Stewart

Scott Stewart

12y
1.7k
1
I need to get the text value from a combo box on one form to assign to a variable in a separate class. I tried
stName=frmParent.ActiveForm.Controls["tblStatesComboBox"].Text
That generated an error that said it was not associated with an object.

What is the proper syntax for reading control values in a separate form. My class is NOT a form. It is just a small class with several values and properties.

Thanks

Answers (7)