Changing a label's text in another form in C#?

后端 未结 12 1547
日久生厌
日久生厌 2020-11-30 09:12

I have a label called LabelX1. This is on form2. On form1, i have a button. I want the button\'s text to be transferred to the other form\'s label. I have tried

<         


        
12条回答
  •  忘掉有多难
    2020-11-30 09:46

    Do you have exception? You can make public property on form2, with setter to set text on the label, or make labex1 access modifier public and set it directly. It should work.

提交回复
热议问题