Full code would be helpful.
I don't know VB but I do know enough about OOP to understand your problem. In most OOPLs, a NullReferenceException is thrown in a few instances:
1. Attempt to reference a variable which you have declared, but to which no value has been assigned
2. Attempt to assign a value of null to a non-nullable type
3. Attempt to use a variable with a null value in an invalid context
Judging from your description, I'd rule out number 2. So, to answer your question, what are combobox1 and control1's types? Are these types nullable? If not, have you attempted to assign a value of null to either of them?
Also, make sure that these variables have been ASSIGNED, not just declared, before you try to use them. A null or unassigned value is not valid in most contexts.
Check your assignment statements and make sure they just use the "=" operator. Operators such as +=, -=, etc, are a bit deceptive in that they ARE NOT assignment operators. You also cannot use increment or decrement operators such as ++ on unassigned variables.
For debugging purposes, if you have a blank declaration statement for these variables in your code, i.e.
...try replacing them with a blank assignment, i.e.
SomeType combobox1 = new SomeType();
(not sure if that is how the construction operator works in VB but I think you get my point)
If that fixes the NullReferenceException, then your problem is that you are somehow winding up with a variable that has not been assigned to at the time when you try to reference its value (you'll probably wind up with a different exception in this case, but that's ok - you'll have found the problem. Assuming the exception isn't about the assignment itself, of course).
Otherwise please post complete code and the location of the exception in order for me to better assist.
Edited by W-Unit, 02 September 2009 - 08:43 PM.