-
When developing WinForm applications with VS, many people start to design forms as soon as they come up, and ignore some important things, such as how the program works.
When we create a new winform project, the system actually creates a form class, but this form class is not the entrance of the program, the entrance of the program is in it, let's take a look at the content of this file:
static class program
The primary entry point to the application.
stathread]
static void main()
form1())
That is, the last sentence form1()) starts our form program.
To make a login form, you add another form, let's say loginform, and write something like this:
static void main()
loginform lf=new loginform();Create an instance.
if( == display.
form1())
Then when doing loginform, when the user clicks "OK" and the verification is passed, a message needs to be sent:
When I press Cancel: =;
If the verification fails, neither the message nor the message will be sent, so that the form will stay until the user clicks the fork button, but the user clicks the fork button, because if( == This condition is not met, the program will not display the main window, and it will end immediately.
-
First the main window opens, then click the button The sub-window appears, and the main window is hidden:
button_click(argevent e ..Button event writes:
form2 f2 = new form2();
It's OK, but if you want to make the main window display again in the sub-window, you may have to use the get set method.
-
Then you start the main form first, then hide it, start the login form, if the login is successful, the main form will be displayed, and the login form x will be dropped.
-
If it's just the intermediate development of Winform: it can be written directly into the app file in the project, in fact, many people who are new to this process will misunderstand that closing the current form and then loading the main form, in fact, the process is like this:
1. Instead of running mainform()), proceed directly;When this window is successfully verified, a tagged value is obtained, and then it is judged to be bool type in the following **:
if(mainform())
else
-
Windows applications.
I'll give you a list of some common techniques for you to see.
1. Database.
This accounts for a large part, including connecting to the database, and then some operations on the data table (adding, deleting, changing, querying) of the basic operations, at least to do a few related small projects out of the proficiency, general management software needs.
2. Communication.
3. Mastery of multi-threading (which can be encountered in any aspect).
5. File reading and writing, this is mainly to pay attention to One is that the xml file is very commonly used, and it is the most widely used for it, and the rest is a custom file, so try to read and write it on your own.
Of course, there are many things that may be used, but these are the most common ones I can think of, and I hope it will help you.
Learning these is when you have a certain foundation.
Now if you don't have any basic knowledge (e.g. C syntax. Skillful use of each control) then learn the basics of it and take your time.
Finally, I wish you a happy Mid-Autumn Festival.
-
My opinion is to first ** a visual studio, which is a more commonly used tool for you to learn winform, and then buy a book, read the help document of visual studio while reading the book, there are a lot of things in it, and then go online to communicate with others.
It's too difficult to learn on your own, and you have to have strong self-control, so it's best to find a training school.
-
Advance C Advanced Programming Book.
-
The first problem is obviously the problem of interface refresh, although I didn't see **, but the difference between Figure 1 and Figure 3 is whether there is an "account" and "what is called" two two yellow things, it is estimated that it is hidden before logging in, so deal with it after calling the login window**, and display it (a better way is to judge the return value of the login window, if the login is successful, it will continue to be hidden, if it is unsuccessful or the login operation is canceled, it will continue to be hidden);
The second problem should actually be an old-fashioned parameter passing problem, I don't know how you deal with it in **, but there should be many ways to pass the account information that has been successfully logged in to the window that needs to display the information, such as using public variables, passing in the constructor, using events and delegates to handle, etc., you can debug it yourself according to your way of processing, and you really can't ask or supplement the question;
That's basically it, I hope it helps.
-
Why do you have to pop up one when you click on the login, it's not better to display it directly on the right.
Many people think that students who graduate from junior high school are too young and have too weak a cultural foundation to learn such a lofty major as software development. But that's not the case. >>>More
The failure of the design solution will lead to the failure of the entire system and eventually the loss of everything. >>>More
In fact, if you want to engage in software development, you must first master the basic knowledge of C++. >>>More
Software development itself is a special process, because there will definitely be some bugs after software development, which can only be found in the process of use, and can be fixed and upgraded in subsequent versions.
"Management by Objectives" is more suitable for software developers. >>>More