c# - Windows form design advice -
i have built touch screen application using windows forms. works great still have design advice.
my application consists of several different windows forms.
my design have 1 mainform of other forms inherit from. in mainform have buttons user can choose form open. when user chooses 1 of options form opened. use following code:
control control = this; // current form, open recording rec = recording.instance; // form user choose open if (control != rec) { rec.show(); // show recording form control.hide(); // hide previous form }
is correct way work forms or should use other way? example, have 1 form , user controls in it.
a few things noticed:
recording.instance
. looks me making these forms singleton. can work, i'd rather see them created/closed needed.rec.show();
nitpick, lot of time want pass current form owner:rec.show(this);
orrec.show(control);
.- inheriting base form good. make work better, build each form custom control, such difference among forms custom control you've added. can use interface or common base control each of these custom controls further control , enforce uniform , feel in app.
Comments
Post a Comment