Good day! Tell me, please, as in Microsoft Visual C ++ 2010, from the main form of the application, change the property of an element to another form. Those. The application has 2 forms. On the first there are a label and a button that opens the second form. On the second form are the textbox, label and button. By clicking on the button in the first form, you need to open the second form (it turned out), write some text in the label. When on the second form they click on the button, the value of the text field must be placed in the label on the first form!

    1 answer 1

    To change the properties there are no difficulties, the main thing is to transfer to the child (second) form, its parent (for example, by clicking the button in the first form), and having this form from the child one can easily change the value of the element (in your case, labels) PS If explained is not clear - you are welcome to koment)

    • Not clear, is it possible to read more? - Igor Kot
    • I apologize only now I noticed that C ++, not C #, but I think there shouldn't be any special problems, in the case of ++ you need to make a reference (*) to the class of the first form, when creating the second form, you need to align this link to something (naturally, ), and then when it is necessary to refer to the first form through a link (which is form1->label1.Text="ad" ). In general, the idea here is it - zuev93
    • Thanks, I will try - Igor Kot
    • PS Oftop, after receiving the answer to the question, it is necessary to mark the best (for you) answer with a tick (next to a vote on the left) - zuev93
    • already noted, thanks again - Igor Kot