0

I have few operation on matrices, each operation is subject to user's choice. each operation has its own interface. In order to save the data of last operations I use GroupBox to save the buttons of the interface. For example if i decide i want to add 2 matrices and i type them and got the result, but then I switch to analyzing matrix(and make the addition GroupBox invisible), I dont lose the data of the addition interface, i can go back to addition and just make the GroupBox visible.

My question is if there is a better way to save the whole interface without just making GroupBox visible/invisible. Is it better to save the data in some .txt file and rebuild entire interface all over again? Basically Im asking if it is ok to hold Gui interface including the data from the user with GroupBox? Hope my question is clear. Im using windows forms Thanks in advance.

svick
  • 236,525
  • 50
  • 385
  • 514
avi.tavdi
  • 305
  • 2
  • 4
  • 17

2 Answers2

0

You don't need to "save the whole interface". Your application data that is currently being worked on should be saved, and then you save enough state data from the current UI in order to be able to recreate its state. This means you don't save an entire groupbox, instead you just save the selected state of each radio button. Try and save the state data in a reasonably UI agnostic way, so that if you alter the UI you don't have to totally rewrite the state save functionality.

slugster
  • 49,403
  • 14
  • 95
  • 145
0

Of course it is better if you keep all your controls with input data available at immediate request, without recreating every time the user interface, when your user switch from input to analyze or viceversa. This will give a snappy response time and a better usability.

From a conceptual point of view, I don't like to hide/show controls on the screen. In your scenario I will try do divide the UI interface in two parts, one with the input controls and another for the analyzing activities. (SplitContainer comes to mind) In this way the user will be able to see on which input data is working and allows you (perhaps) to dinamically change the analyzing results while changing the input data.

However, I don't know how complex are the input data and analyze parts. Sometimes, if you have a very cluttered form is better to separate the two functionality inside a tabcontrol or separate windows (or, as you have already done, with this groupbox hide/show functionality).

Steve
  • 213,761
  • 22
  • 232
  • 286