Hallo,
wird deine Unterform auch mit
DialogResult.OK geschlossen, also wird der if-Block überhaupt betreten?
Bei den beiden int-Werten würde ich persönlich auf Properties zurückgreifen, also
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30:
| class DeineUnterForm { public int BildBreite { get { int val; if (int.TryParse(textBoxBreite.Text, out val)) return val; return -1; } set { textBoxBreite.Text = value.ToString(); } } public int BildHoehe { get { int val; if (int.TryParse(textBoxHoehe.Text, out val)) return val; return -1; } set { textBoxHoehe.Text = value.ToString(); } } } |
und dann in der Hauptform:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7:
| ...
if (FrageBildgroesse.DialogResult == DialogResult.OK) { pictureBox1.Width = FrageBildgroesse.BildBreite; pictureBox1.Height = FrageBildgroesse.BildHoehe; } |
Der längste Typ-Name im .NET-Framework ist: ListViewVirtualItemsSelectionRangeChangedEventHandler