[RESOLVED] Change buttonname on a second form
I want to change a button name of form1 and I want to do this from form2.
When i click on a button on form2 i want to change it.
I'm using form1.button1.text="Name"
But i get the message:
'Button1' is not a member of System.Windows.Forms.Mainmenu
How can i do this??
Re: Change buttonname on a second form
You apparently have a MainMenu component on Form2 named "Form1". Not a very appropriate name for a menu, plus you should use a MenuStrip in preference to a mainMenu anyway.
Re: Change buttonname on a second form
The mainmenu form is called menu and the second form is called settings.
I open the settings form on the menustrip of the menu form. On the settings form i have a button and when i press this the name of a button on the mainmenu has to be changed. I hope that this makes it more clear.
Re: Change buttonname on a second form
If the name of the form is MainMenu, then why are you using Form1 in your code? :confused:
Re: Change buttonname on a second form
Is the name of the Button on form MainMenu called Button1?
Re: Change buttonname on a second form
I have changed the name menu to main_menu of my first form and now it works fine. You can't use the name menu.