Hallo,
ich bin ziemlich neu bei C# und habe ein kleines Problem das mich sehr nervt.
Ich habe eine Form1.cs mit ein paar comboBox'es die ich in dem file Form1.Designer wie folgt deklariere:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
| this.comboBoxSL_R.FormattingEnabled = true; this.comboBoxSL_R.Location = new System.Drawing.Point(200, 188); this.comboBoxSL_R.Name = "comboBoxSL_R"; this.comboBoxSL_R.Size = new System.Drawing.Size(60, 21); this.comboBoxSL_R.TabIndex = 11; this.comboBoxSL_R.Items.Add(new MyItemClass("1", "1")); this.comboBoxSL_R.Items.Add(new MyItemClass("2", "2")); this.comboBoxSL_R.Items.Add(new MyItemClass("3", "3")); this.comboBoxSL_R.Items.Add(new MyItemClass("4", "4")); this.comboBoxSL_R.Items.Add(new MyItemClass("5", "5")); this.comboBoxSL_R.Items.Add(new MyItemClass("6", "6")); this.comboBoxSL_R.Items.Add(new MyItemClass("7", "7")); this.comboBoxSL_R.Items.Add(new MyItemClass("8", "8")); this.comboBoxSL_R.Items.Add(new MyItemClass("9", "9")); this.comboBoxSL_R.Items.Add(new MyItemClass("10", "10")); |
Außerdem habe ich in der Form1 einen webBrowser1. Wenn ich diesen in der Form1 verschiebe wird meine Deklaration der combo.Boxen im file Form1.Designer.cs überschrieben.
Der Ablauf nochmal in Stichpunkten - ich ziehe den webBrowser1 an eine andere Stelle und meine Deklarationen sind verschwunden. Danach steht nur noch das Grundgerüst einer comboBox im file Form1.Designer1.cs das wie folgt aussieht:
C#-Quelltext
1: 2: 3: 4: 5:
| this.comboBoxSL_R.FormattingEnabled = true; this.comboBoxSL_R.Location = new System.Drawing.Point(200, 188); this.comboBoxSL_R.Name = "comboBoxSL_R"; this.comboBoxSL_R.Size = new System.Drawing.Size(60, 21); this.comboBoxSL_R.TabIndex = 11; |
OK, ich dachte mir "dann rührst Du halt das Fenster nicht mehr an" aber es ist trotzdem passiert als ich eine neue Zeile in mein Programm Form1.cs geschrieben habe.
C#-Quelltext
1:
| sw.WriteLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"); |
Ich weiß nicht ob es gerade speziell damit zu tun hat das diese Zeile auch über den webBrowser angezeigt wird, aber das Problem nervt ziemlich. Ich muß jedesmal die Definition der comboBoxen aus einem backup kopieren und in mein aktuelles Projekt wieder einfügen.
Weiß jemand woran das liegt und wie ich das abstellen kan?
Danke im voraus,
Carsten
Moderiert von
Christian S.: C#-Tags hinzugefügtModeriert von
Christian S.: Topic aus C# - Die Sprache verschoben am Do 06.03.2008 um 15:47