|
-
Aug 26th, 2009, 01:45 AM
#1
Thread Starter
Lively Member
[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??
-
Aug 26th, 2009, 01:53 AM
#2
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.
-
Aug 26th, 2009, 02:07 AM
#3
Thread Starter
Lively Member
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.
-
Aug 26th, 2009, 06:32 AM
#4
Re: Change buttonname on a second form
If the name of the form is MainMenu, then why are you using Form1 in your code?
-
Aug 26th, 2009, 07:10 AM
#5
Frenzied Member
Re: Change buttonname on a second form
Is the name of the Button on form MainMenu called Button1?
-
Aug 26th, 2009, 10:44 AM
#6
Thread Starter
Lively Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|