I am trying to add some items to combobox, like its showed on msdn site, but it throws me an null reference exception
comboBox1.Items.Add("test");
I try to change it on
ComboBox combobox1 = new ComboBox();
object test = new object();
test= "test";
comboBox1.Items.Add(test);
But it didnt works too
Can you tell me, where is the problem?
Thanks
EDIT:
SOLVED :
problem was, that I was calling
InitializeComponent();
after this code, not before, now it works as I would like before 🙂
Replace With
combobox1andcomboBox1is not same