# .NET and More > C# >  .net Maui

## ubkra

I'm looking into .net maul as a possible cross platform solution. My project would be multiple pages. 

Is it possible to open a login page and have it like a dialog box which you can't exit unless you close the program of successfully login? I've googled it all after and can't find a suitable answer so I'm assuming now but that can't be right?

----------


## DaveDavis

ChatGPT REPLY: Yes, it is possible to create a login page that behaves like a dialog box in .NET.

One way to do this is to use a modal dialog window. In .NET, a modal dialog window is a top-level window with its own taskbar button that blocks input to other windows in the same application. Modal dialogs are often used for login pages because they require the user to interact with them before they can continue using the application.

To create a modal dialog in .NET, you can use the ShowDialog method of the Form class. This method displays the form as a modal dialog and blocks input to other forms in the same application until the form is closed.

Here is an example of how you can use the ShowDialog method to display a login form as a modal dialog:


```
// Create a new instance of the login form
LoginForm loginForm = new LoginForm();

// Show the login form as a modal dialog
DialogResult result = loginForm.ShowDialog();

// Check the result of the login form
if (result == DialogResult.OK)
{
    // Login was successful
}
else
{
    // Login was not successful
}
```

In this example, the ShowDialog method displays the login form as a modal dialog and blocks input to other forms in the application until the login form is closed. The DialogResult returned by the ShowDialog method indicates whether the login was successful or not.

I hope this helps! Let me know if you have any other questions.

----------

