CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Oklahoma
    Posts
    263

    Changing Button Text

    I have a button in a modeless dialog box called IDC_PAUSE. This button will cause a data stream, which is filling an edit control, to pause. What I want to do is change the text of the button to &Resume after the PAUSE has been pressed. Then when RESUME is pressed, it goes back to PAUSE.

    My problem is I don't know how to do this. I see where I can use the SetButtonText(index, *text) and it should work. tried it but fails, assertion error and others. Can someone post a snippet of code to change the text on the button? How do I know what the button index is?

    Thanks in advance!

    John Hagen



  2. #2
    Join Date
    May 1999
    Posts
    53

    Try this

    CWnd* pWnd = GetDlgItem(IDC_PAUSE);
    pWnd->SetWindowText("Resume");



  3. #3
    Join Date
    May 1999
    Location
    Oklahoma
    Posts
    263

    Re: Try this

    Than you for the response. I'll give it a try.

    John



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

Featured