c# - How to reset a form to its default appearance, after interaction with user -
c# - How to reset a form to its default appearance, after interaction with user -
i wanted default view of form after interaction user. in other words after changes has been implied user, command homecoming form initial pop appearance? have many controls, , calculations, dont want go on command 1 1 , set them null or default value. great, if initate form 1 time more, how.
you seek clearing controls on form, calling initializecomponent()
method.
while (controls.count > 0) { controls[0].dispose(); } initializecomponent();
edit:
another alternative wouldn't cause performance issues utilize info binding. create info object maps 1 1 of fields you'd reset, 1 time time reset form set info source of form new instance of info object.
c# winforms
Comments
Post a Comment