i want to prompt the user to enter his number to get the details from data开发者_如何学运维base before the form Load event fire in windows forms application using c#?
can anyone please tell me how to implement this?
thanks in advance.
Put it into the Main method of Program.cs.
You can show a winform or dialog in the Main method before you run your main application. This allows the user to enter some data and you can then act on that before running your main form.
I have an application that can start in one of two ways. I display a selector window from Main. The user selects from the options and I collect that when the selector form closes.
I then start my main form taking account of that. This would also allow you to start different forms depending on the user input if you wish
Write your code in program.cs or in constructor of form
精彩评论