Designer throwing up an error!
<p>I have a dropdown list that I want to show only certain options when a bool is true of false.</p>

<pre><code>if (mainForm.boolEdit == true)
        {
            this.cmbStatusBox.Items.AddRange(new object[] {
            "Cooking",
            "In-transit",
            "Delivered"});
        }
        else
        {
            this.cmbStatusBox.Items.AddRange(new object[] {
            "Ordered"});
        }
</code></pre>

<p>I put this code into the saveForm.Designer.cs and got the following error:</p>

<p>The designer cannot process the code at line 205: </p>

<p>if (mainForm.boolEdit == true)
            {
                this.cmbStatusBox.Items.AddRange(new object[] {
                "Cooking",
                "In-transit",
                "Delivered"});
            }
            else
            {
                this.cmbStatusBox.Items.AddRange(new object[] {
                "Ordered"});
            }</p>

<p>The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified.  Please remove any changes and try opening the designer again.</p>

<p>What are my alternatives?</p>

<p>EDIT! I have now put the designer back to normal as follows :</p>

<pre><code>this.cmbStatusBox.Items.AddRange(new object[] {
        "Ordered",
        "Cooking",
        "In-transit",
        "Delivered"});
</code></pre>

<p>and in the formload, i have put the following:</p>

<pre><code>if (mainForm.boolEdit == true)
        {
            this.cmbStatusBox.Items.AddRange(new object[] {
            "Cooking",
            "In-transit",
            "Delivered"});
        }
        else
        {
            this.cmbStatusBox.Items.AddRange(new object[] {
            "Ordered"});
        }
</code></pre>

<p>Problem is, I now have both the designer and the formload putting names into the dropdown. Ideally i just want the ones from the second lot of code, but when i click edit (which brings up what has already been done), the dropdowns are populated by what is saved if the designer populates it. If the formload populates the dropdown, when i edit, the dropdown doesnt specify what has already been saved.</p>

<p>Any ideas?</p>
