Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How to change button text in form, from another form?

$
0
0

Hi All,

I'm beginner in win form.

I want to know how to change the property of button, that is button text.

ie: I have 2 form, form1 and form2. each form has 1 button control.

my startup form is form1, when I click button in form1 will do form2 show. (now we have 2 open form, form1 and form2) and then I want if I click button in form2, the button text in form1 will be change.

I try this code in button in form2:

form1 oForm1 = new form1();

oForm1.button1.Text = "test";

there is no any changing.

hope you all know what I've explained :)

need help :)

thanks.


Viewing all articles
Browse latest Browse all 12583

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>