CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Changing Static Controls Text

    Hi All
    I have a static control in a dialog box
    I know I use SetDlgItemText(IDC_STATICITEM, CString str) to change a static items text
    I would like to be able to change the static controls text from my main view class
    I tried creating a static function that calls SetDlgItemText but developers studio says I can't call
    SetDlgItemText from a static function
    Any ideas how I could change a static controls text from my view class???
    Thanks Alot


  2. #2
    Join Date
    Apr 1999
    Posts
    306

    Re: Changing Static Controls Text

    I am not sure what exactly you wanna do, but here is how I catch the meaning:

    make a member var in the dialog class of type CString, and then do this:

    in the view class --
    CDialog MyDlg;
    MyDlg.m_static_text = "What ever I want to";
    MyDlg.DoModal();

    in the InitDialog() of the dialog class
    SetDlgItemText(IDC_STATIC1,m_static_text);



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