I created a new c# win app project in vs.net on winxp.
I added a basic combo box to my form using the toolbox.
In the code editor I create an array that contains a list of subdirectories in the form1 method and call the initialize method:
InitializeComponent(myArray);.
Now I know the generated comments say not to edit the Initialize method, but I added an arguement to it as such:
private void InitializeComponent(string[] comboList)
To my combobox I added:
this.combobox1.Items.AddRange(comboList);
Now when I go back to the design view, the combobox disappears, but the code remains. I complie it and the combobox shows up fine with the desired list of items. Back in the designer I add a text box to the form using the toolbox. When I switch to the code editor, my combobox code has disappeared and when compiled, no more combobox.
Any ideas?
Thanks
I added a basic combo box to my form using the toolbox.
In the code editor I create an array that contains a list of subdirectories in the form1 method and call the initialize method:
InitializeComponent(myArray);.
Now I know the generated comments say not to edit the Initialize method, but I added an arguement to it as such:
private void InitializeComponent(string[] comboList)
To my combobox I added:
this.combobox1.Items.AddRange(comboList);
Now when I go back to the design view, the combobox disappears, but the code remains. I complie it and the combobox shows up fine with the desired list of items. Back in the designer I add a text box to the form using the toolbox. When I switch to the code editor, my combobox code has disappeared and when compiled, no more combobox.
Any ideas?
Thanks