question

kennethquirici-0334 avatar image
0 Votes"
kennethquirici-0334 asked TeemoTang-MSFT commented

how do i pass information from a form to a subform in c#

I define a subform in the main form: the subform's parent is the main form.

         public subForm(mainForm p)
         {
             parent = p;

I want the subform to display a textbox. The user will select a line from the textbox and that text will be passed back to the main form.

How can I do this?

I'm getting very confused about where and how to define variables to pass the data. Do I define them in the main form? in the subform? in the textbox of the subform?

Any help cutting thru [my] fog would be appreciated.

Regards,

Ken

windows-10-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Ken,

Welcome to Microsoft Q&A Platform.
I see you ask a C# development related question, please add corresponding tag under your post, such as development language or development Platform and delete windows-10-general tag.
Windows-10-general tag is used for discussing Windows 10 built-in features and Windows 10 system related issue, it is not related to C# development.
Thanks for understanding and cooperating.


If the Answer is helpful, please click "Accept Answer" and upvote it.
Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 Votes 0 ·

0 Answers