Close in LoginForm — faruk. In This is still the cleanest of the options available. The advice to launch the login dialog after the form is created in many other responses is an anti-pattern and is only useful for applications that allow unauthenticated user interactions.
I would do this the other way round. EnableVisualStyles ; Application. Run logon ; if logon. MrEyes MrEyes 12k 9 9 gold badges 45 45 silver badges 66 66 bronze badges.
Is it ok also to initially hide the Main form. Then show it when login is successful? Why load the main form at all until the login is successful? When I make login form to show on form load. It still show the main form on the background. And when I add code "this. Now it's work and look more professional. But when I look at other comment the others comment that shouldn't do the main form process until user login success so I use your 2nd example code and It's work too.
Thank you — Anukul Limpanasil. SetMainForm new Portal ; Program. ShowMainForm ; this. MoMo MoMo 71 1 1 silver badge 2 2 bronze badges. It's simple. Here is the code. Barth 8, 71 71 gold badges 48 48 silver badges 63 63 bronze badges.
Shanita Weerasinghe Shanita Weerasinghe 51 1 1 silver badge 1 1 bronze badge. Miguel Gamboa Miguel Gamboa 21 1 1 bronze badge. That's only available for VB. Net projects. Stop ; this. Mehmet Mehmet 86 4 4 bronze badges. Welcome to Stack Overflow. Please add some comment to your answer. This is the most elegant solution. Hide ; mainForm. ShowDialog ; this. Branches Tags. Could not load branches. Could not load tags.
Latest commit. Git stats 9 commits. Failed to load latest commit information. View code. Also, how do I create a form in Visual Studio? Creating a Form Using Visual Studio. Select Windows Application in the Templates pane on the right side of the dialog box. Enter a name in the Name text box. Click OK. Make a form and remove the text and change "Show Icon" to false. Step 2: Add the Interface. Add 2 labels, 2 textboxes, and 1 button.
In the Based on list, click Database. If you are designing a browser-compatible form template, select the Enable browser-compatible features only check box. Step 2: Drag and drop a button. Now from the toolbox drag and drop a button and click on the button.
Data; using System. Drawing; using System. Text; using System. Forms; using System. Show es. Learn how to use the debugger. We aren't here to do your homework for you. Add your solution here. OK Paste as. Treat my content as plain text, not as HTML. Existing Members Sign in to your account. This email is in use. Do you need your password?
Submit your solution! When answering a question please: Read the question carefully. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
0コメント