Results 1 to 6 of 6

Thread: [RESOLVED] Change buttonname on a second form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2008
    Location
    Netherlands
    Posts
    105

    Resolved [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??

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2008
    Location
    Netherlands
    Posts
    105

    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.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Change buttonname on a second form

    If the name of the form is MainMenu, then why are you using Form1 in your code?

  5. #5
    Frenzied Member CoachBarker's Avatar
    Join Date
    Aug 2007
    Location
    Central NY State
    Posts
    1,121

    Re: Change buttonname on a second form

    Is the name of the Button on form MainMenu called Button1?
    Thanks
    CoachBarker

    Code Bank Contribution
    Login/Manage Users/Navigate Records
    VB.Net | C#

    Helpful Links: VB.net Tutorial | C Sharp Tutorial | SQL Basics

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2008
    Location
    Netherlands
    Posts
    105

    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
  •  



Click Here to Expand Forum to Full Width