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

Thread: status bar

  1. #1
    Join Date
    May 1999
    Posts
    73

    status bar

    hi...if you could help....
    i have implemented a status bar in Mainframe.cpp to display a CString variable which can be modified in a function. the variable is also made global. however, when i modify the CString variable in another function ( of another class ), i realise that the change is not updated at the status bar at all. any idea what's wrong ?


  2. #2
    Join Date
    May 1999
    Posts
    26

    Re: status bar


    You may need to call SetPaneText() to update the status bar display

    Santhosh


  3. #3
    Join Date
    May 1999
    Posts
    73

    Re: status bar

    hi...
    thanx for your reply.
    is SetPaneText() the function i need to add at MainFrame.cpp to update the status bar while the variable associated with it can be accessed and modified anywhere in the program ?
    i did this but i can't have the variable updated at the status bar when it is modified. by the way, i have 2 different functions that can modify the same variable which i made global.
    hope you can help....


  4. #4
    Join Date
    May 1999
    Posts
    26

    Re: status bar

    Hi!

    Whenever you want to update the statusbar, instead of seting the string variable, why don't you get a pointer to the mainframe window, and then the status bar object, and call its SetPaneText()?

    The code can be like this:

    CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();

    pMainFrame->m_wndStatusBar.SetPaneText (0, "New Text");

    Assuming that m_wndStatusBar is the Status Bar object and you wanted to change the text of the first pane (pane 0) of the Status Bar...

    Santhosh
    PS: There may be better ways to do this. Have a look at the status bar section in this site.




  5. #5
    Join Date
    May 1999
    Posts
    73

    Re: status bar

    hi...
    thanx.
    i'll try that to see if it works...


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