Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have login screen that should appear every first open of the program, the problem is that i have a button to restart the program every new sale operation, so .. the login screen appears every restart of the program and i don't want that to happen i want it just to appear on the first application open.

does anyone has a trick or any way to solve this.

thank you

What I have tried:

i didn't tried anything. :) :) :) :) :) :) :) :) :) :)
Posted
Updated 4-Jun-19 8:59am
Comments
Dave Kreskowiak 4-Jun-19 15:05pm    
Why on earth do you have a "restart" button for "every new sale operation"? What does this mean?
Member 11903597 4-Jun-19 15:25pm    
after new sale operation smart ass
Dave Kreskowiak 4-Jun-19 19:48pm    
OK, smartass, "restarting" your entire application after a sale is NOT NORMAL. I'm looking for an explanation as to why you think this is a necessary thing to do.

1 solution

You can call Process.Start() with a parameter, e.g. "restart" and read the arguments in Program.Main(), something like this:
Dim p As New Process
p.StartInfo.FileName = "MyProgram.exe"
p.StartInfo.Arguments = "restart"
p.StartInfo.WindowStyle = mWindowStyle
p.Start()
Also see: Environment.GetCommandLineArgs Method (System) | Microsoft Docs[^]
 
Share this answer
 
v3
Comments
Member 11903597 4-Jun-19 15:04pm    
could you explain please
Member 11903597 4-Jun-19 15:27pm    
thank you, you inspired me to :
separate the login from the main application
and use process.start from the login form to run the main app
by that the login screen won't appear every restart
RickZeeland 4-Jun-19 15:39pm    
If it works I will no longer ask questions :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900