CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Posts
    94

    Static Control Caption

    i want to change the caption of the static control during runtime.
    suppose the ID of static control is IDC_STATIC. (i don't have any member variable mapped to static control.)
    What could be the code?

    Thanks.

  2. #2
    Join Date
    Jul 2002
    Location
    Scotland
    Posts
    288
    Hi,

    Assign the control a new ID then use this to get the a CWnd*.
    Code:
    CWnd* pWnd = GetDlgItem(IDC_CTRL_ID) ;
    Then set it's text using
    Code:
    pWnd->SetWindowText("New Caption") ;
    Or, add a new variable (CEdit) as well as a new ID and then use:
    Code:
    m_Static.SetWindowText("New Caption") ;
    HTH
    --
    Regards,
    William.

    SELECT COUNT(*) FROM USERS WHERE KNOWLEDGE != NULL ;
    0 Rows Returned!

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