CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Binding Data to Silverlight 4.0 Controls Using ASP.NET MVC Framework 2.0
  • ADO.NET Data Services in the .NET Framework
  • Visual C++ Programming: What's new for MFC library in VC++ 2010?
  • Microsoft Visual Studio LightSwitch and What It Can Do For You

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old February 18th, 2010, 11:12 PM
    jimmyjones jimmyjones is offline
    Junior Member
     
    Join Date: Feb 2010
    Posts: 1
    jimmyjones is an unknown quantity at this point (<10)
    How to reference text Label outside of Form’s code?

    How do I reference (+ change) the Label that has been set, outside the Form's code. Eg. Another cpp or header file?


    Code Sample 1

    //Set Label.
    this->TextLabel1= (gcnew System::Windows::Forms::Label());

    Code Sample 2

    //When Button Clicked....
    TextLabel1->Text = "Button has been pressed";
    Reply With Quote
      #2    
    Old February 18th, 2010, 11:17 PM
    Msm Msm is offline
    Member
     
    Join Date: Aug 2008
    Posts: 347
    Msm is on a distinguished road (10+)
    Re: How to reference text Label outside of Form’s code?

    I think you want to change the labale text run time. Make one globle variable and check when button is click then you set the "New text" in labale.

    I hope it's help you.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 09:05 PM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.