Hi all
I am designing an application where the user can enter information on different forms that are accessed from a main window. Each form contains a combination of text boxes, radio buttons, etc.
The problem I am having is that if the user closes the form (using the standard X button at the top of the form) and then loads it again from the main window, the form returns to its default values and doesn't save the values that the user entered.
I did consider using tabs instead of separate forms, but there will be situations where the user will want to compare the entries on several forms simultaneously.
So, is it possible (without having to write code to store all the variables and reload them) to save the state of the form when it has been closed and reproduce the user's entries when it is opened again?
P.s. I am quite new to visual studio programming.
Thanks in advance.
Terry
You do not want the user to be able to click on the Close button (the little "x" in the upper right).
Method #1: The ControlBox property
The WinForm ControlBox property is a good place to start, but it shows or hides the entire control box. That means it either shows or hides all three buttons. That isn't useful because one maywant the minimize and maximize buttons to work or because one may want those buttons to appear for visual consistency.
Method #2: Disabling the Close button directly
This thread on microsoft.public.dotnet.fr
The result:
- the control box is still visible (min, max, close)
- the close button will appear disabled
- clicking on the close button will not do anything
Save