AB form cross-transfer parameters

Source: Internet
Author: User

I find several, are not reliable, not to say that not reliable, I feel too cumbersome

Two. The parent window passes through the child window, there are two ways (I think the relatively simple method ha),

1 The first method: Create a new property in a Subwindow, and then create a new method, of course, by displaying the properties of a form control (such as a TextBox);

The child window is then instantiated in the parent window and then invoked with the instantiated child window property, assigning a value to the property, then invoking the method that instantiates the child window, and then displaying the child window

2 The second method because you want to pass parameters, must have an action, and run the program, in the parent window when the child window can be initialized in the initialization of the child window assignment (search function in Word, you select a paragraph of text, then click Search, you try not to see I say here)

1. Add parameters directly to the initialization subwindow (the form's constructor) and assign the parameters to the Subwindow control (e.g. textbox) in the function

Public B (String canhu)
{
InitializeComponent ();
TextBox1.Text = Canhu;
}

2 "When instantiating a subform in a parent form, write the parameter directly in the parameter (b b = new B (TextBox1.Text);)

It's simply not the source code.

Three. The child window passes through the parent window, because it is passed when the child window is opened, so when the parent window is instantiated, the form to be passed is indicated, because instantiating a form can be any form, or the subform itself, so it doesn't make sense to pass it.

Cond.......

AB form cross-transfer parameters

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.