WinForm actions between forms

Source: Internet
Author: User

1

Open another form with one form button

Form F2 = new Form2 ();
F2. Show ();

Open the second page through this to show only one page can only hide the first page

If the first page closes, the second page is closed.

2 Passing values between forms

Passing values between forms requires two or more forms

Form F2 = new Form2 (the value to be passed);
F2. Show ();

And then another form that needs this value

Users z = null;//is instantiated based on the type of the value
Public FORM4 (Users a)//method here also write the value to be passed in, note the type
{
InitializeComponent ();
z = A; This time the value is passed in, because the value is defined outside the method, and all can be called at random within the namespace.

WinForm actions between forms

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.