I am trying to create a small project that uses several forms (dialogs) for different states and starts in several problems. My dialogs are Login, Settings and Screen. When the application starts, the login form is displayed
Application.Run(new login());
from it, the user can open the configuration form or, if certain requirements are met, the display form.
Q1: how can I make the registration form inaccessible to the user when I open the settings form (I want the user to fill in the fields in the "Settings" form, then click the "Save" button to exit before he can do anything else in the Login form )
Q2: how can I hide the login form when the user opens the display form and displays it again when the user closes the display form.
for Q1: I do not have ideea, I just thought I could do the same thing as in Q2.
for Q2: I tried to submit a Dispaly form login form object to use the ShowDialog () method.
in the login form, I hide the form and show the display form as follows:
this.Hide(); Display cat = new Display(ConString, idp, this); cat.ShowDialog();
in display form. I am trying to close the dialog when exiting and show the login form as shown below.
private void Display_FormClosed(object sender, FormClosedEventArgs e) { this.Close(); this.l.ShowDialog(); }
where l var is the Login object sent to the Display constructor, such as Login. the problem is that the display form does not close, and if the user clicks the button again, a new dialog will appear, and I want 1 instance of the form to be displayed.
thanks