C #-11th weekly Task 1 login form and main form

Source: Internet
Author: User

First, the login form:

 

Using system; using system. collections. generic; using system. componentmodel; using system. data; using system. drawing; using system. LINQ; using system. text; using system. windows. forms; namespace windowsformsapplication1 {public partial class frmlogin: FORM {public frmlogin () {initializecomponent ();} private void frmlogin_load (Object sender, eventargs e) {} form frmmain; private void button#click (objec T sender, eventargs e) {// requirement: In the login form, assume that when the user enters the Account "zhangsan" and the password is "123" (the password is displayed *) //, destroy the logon form and open the main form. Otherwise, an error message is displayed, such as "incorrect account or password" If (textbox1.text. equals ("zhangsan") & textbox2.text. equals ("123") {frmmain = new frmmain (); frmmain. show ();} else {MessageBox. show ("your account or password is incorrect") ;}} private void textbox=textchanged (Object sender, eventargs e) {} private void textbox2_textchanged (Object sender, eventargs e ){}}}

Next is the main form:

 

Using system; using system. collections. generic; using system. componentmodel; using system. data; using system. drawing; using system. LINQ; using system. text; using system. windows. forms; namespace windowsformsapplication1 {public partial class frmmain: FORM {public frmmain () {initializecomponent ();} private void frmmain_load (Object sender, eventargs E) {} private void file toolstripmenuitem_click (Object sender, eventargs e) {} private void Open main form 1toolstripmenuitem_click (Object sender, eventargs E) {frm subform 1 F = new frm subform 1 (); F. show (); F. mdiparent = This;} private void open the main form 2toolstripmenuitem_click (Object sender, eventargs e) {foreach (VAR item in this. mdichildren) {item. dispose ();} frm subform 2 F1 = new frm subform 2 (); f1.show (); f1.mdiparent = This;} private void frmmain_load_1 (Object sender, eventargs E) {}}}

The last two subforms

 

Using system; using system. collections. generic; using system. componentmodel; using system. data; using system. drawing; using system. LINQ; using system. text; using system. windows. forms; namespace windowsformsapplication1 {public partial class frm subform 1: FORM {public frm subform 1 () {initializecomponent ();} private void frm subform upload load (Object sender, eventargs e ){}}}

 

Using system; using system. collections. generic; using system. componentmodel; using system. data; using system. drawing; using system. LINQ; using system. text; using system. windows. forms; namespace windowsformsapplication1 {public partial class frm sub-Form 2: FORM {public frm sub-Form 2 () {initializecomponent ();} private void frm sub-form 2_load (Object sender, eventargs e ){}}}

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.