In my eyes it is an appropriated way to build up your form that way. The *.Designer
file is for designer generated code - but if you need to add custom logic to modify your GUI the *.c
s file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChanged
,SelectedItemChanged
, ...) I would suggest to use that.There is some repeating logic for creating the
ComboBox
/Label
and so on. That logic could be extracted to a separted method. For instance:private static ComboBox CreateComboBox() { return new ComboBox() { Font = new Font("Arial", 12F, FontStyle.Regular) Size = new Size(200, 22) DropDownStyle = ComboBoxStyle.DropDownList } }
private static ComboBox CreateComboBox()
{
return new ComboBox()
{
Font = new Font("Arial", 12F, FontStyle.Regular)
Size = new Size(200, 22)
DropDownStyle = ComboBoxStyle.DropDownList
}
}
In my eyes it is an appropriated way to build up your form that way. The *.Designer
file is for designer generated code - but if you need to add custom logic to modify your GUI the *.c
s file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChanged
,SelectedItemChanged
, ...) I would suggest to use that.There is some repeating logic for creating the
ComboBox
/Label
and so on. That logic could be extracted to a separted method. For instance:
private static ComboBox CreateComboBox()
{
return new ComboBox()
{
Font = new Font("Arial", 12F, FontStyle.Regular)
Size = new Size(200, 22)
DropDownStyle = ComboBoxStyle.DropDownList
}
}
In my eyes it is an appropriated way to build up your form that way. The *.Designer
file is for designer generated code - but if you need to add custom logic to modify your GUI the *.c
s file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChanged
,SelectedItemChanged
, ...) I would suggest to use that.There is some repeating logic for creating the
ComboBox
/Label
and so on. That logic could be extracted to a separted method. For instance:private static ComboBox CreateComboBox() { return new ComboBox() { Font = new Font("Arial", 12F, FontStyle.Regular) Size = new Size(200, 22) DropDownStyle = ComboBoxStyle.DropDownList } }
In my eyes it is an appropriated way to build up your form that way. The *.DesingerDesigner
file is for designer generated code - but if you need to add custom logic to modify your GUI the *.c
s file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChanged
,SelectedItemChanged
, ...) I would suggest to use that.There is some repeating logic for creating the
ComboBox
/Label
and so on. That logic could be extracted to a separted method. For instance:
_
private static ComboBox CreateComboBox()
{
return new ComboBox()
{
Font = new Font("Arial", 12F, FontStyle.Regular)
Size = new Size(200, 22)
DropDownStyle = ComboBoxStyle.DropDownList
}
}
In my eyes it is an appropriated way to build up your form that way. The *.Desinger
file is for designer generated code - but if you need to add custom logic to modify your GUI the *.c
s file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChanged
,SelectedItemChanged
, ...) I would suggest to use that.There is some repeating logic for creating the
ComboBox
/Label
and so on. That logic could be extracted to a separted method. For instance:
_
private static ComboBox CreateComboBox()
{
return new ComboBox()
{
Font = new Font("Arial", 12F, FontStyle.Regular)
Size = new Size(200, 22)
DropDownStyle = ComboBoxStyle.DropDownList
}
}
In my eyes it is an appropriated way to build up your form that way. The *.Designer
file is for designer generated code - but if you need to add custom logic to modify your GUI the *.c
s file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChanged
,SelectedItemChanged
, ...) I would suggest to use that.There is some repeating logic for creating the
ComboBox
/Label
and so on. That logic could be extracted to a separted method. For instance:
private static ComboBox CreateComboBox()
{
return new ComboBox()
{
Font = new Font("Arial", 12F, FontStyle.Regular)
Size = new Size(200, 22)
DropDownStyle = ComboBoxStyle.DropDownList
}
}
In my eyes it is an appropriated way to build up your form that way. The *.Desinger*.Desinger
file is for designer generated code - but if you need to add custom logic to modify your GUI the *.cs*.c
s file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChangedCheckBoxChanged
, SelectedItemChangedSelectedItemChanged
, ...) I would suggest to use that.There is some repeating logic for creating the combobx
ComboBox
/ lableLabel
and so on. That logic could be extracted to a separted method. For instance:
_
private static ComboBox CreateComboBox()
{
return new ComboBox()
{
Font = new Font("Arial", 12F, FontStyle.Regular)
Size = new Size(200, 22)
DropDownStyle = ComboBoxStyle.DropDownList
}
}
In my eyes it is an appropriated way to build up your form that way. The *.Desinger file is for designer generated code - but if you need to add custom logic to modify your GUI the *.cs file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChanged, SelectedItemChanged, ...) I would suggest to use that.There is some repeating logic for creating the combobx / lable and so on. That logic could be extracted to a separted method. For instance:
_
private static ComboBox CreateComboBox()
{
return new ComboBox()
{
Font = new Font("Arial", 12F, FontStyle.Regular)
Size = new Size(200, 22)
DropDownStyle = ComboBoxStyle.DropDownList
}
}
In my eyes it is an appropriated way to build up your form that way. The *.Desinger
file is for designer generated code - but if you need to add custom logic to modify your GUI the *.c
s file is the correct location.
Just a few points:
There are some numbers (115, 70, 35, ...) that seems to have a special meening (e.g. row height, margin, whatever). IMHO it makes sense to store that numbers as constants with a meaningful name and use that constants instead.
I am not sure if the
MouseUp
event is the right place to trigger that kind of logic. If there is another event (CheckBoxChanged
,SelectedItemChanged
, ...) I would suggest to use that.There is some repeating logic for creating the
ComboBox
/Label
and so on. That logic could be extracted to a separted method. For instance:
_
private static ComboBox CreateComboBox()
{
return new ComboBox()
{
Font = new Font("Arial", 12F, FontStyle.Regular)
Size = new Size(200, 22)
DropDownStyle = ComboBoxStyle.DropDownList
}
}