question

AMERSAID-7084 avatar image
0 Votes"
AMERSAID-7084 asked AMERSAID-7084 commented

Sending a value from an interface to a previous interface

I have three simple interfaces Windows form. I want to send a value from the third interface it appears in the second interface .Where the second interface remains open, which is the main, and the third sub-interface is closed . The windows are opened in order from 1 to 3. Where I want the following: that the label appears on the second interface and a value is added to it.

I tried the following code and nothing works؟؟.



 MAIN FORM2 = new MAIN();
    
            FORM2.LAB_A.Visible = true;
            FORM2.LAB_A.Text = DATATABLA.Rows.Count.ToString();
dotnet-csharp
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.

1 Answer

Viorel-1 avatar image
1 Vote"
Viorel-1 answered AMERSAID-7084 commented

Try replacing the first line:

MAIN form2 = (MAIN)Application.OpenForms["MAIN"];

It assumes that there is a single form called "MAIN".


· 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
Viorel

Yes, the code solved the problem .

0 Votes 0 ·