Click to See Complete Forum and Search --> : status bar
april
May 13th, 1999, 01:15 PM
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 ?
scp
May 14th, 1999, 10:15 AM
You may need to call SetPaneText() to update the status bar display
Santhosh
april
May 14th, 1999, 02:50 PM
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....
scp
May 14th, 1999, 03:22 PM
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.
april
May 15th, 1999, 11:12 PM
hi...
thanx.
i'll try that to see if it works...
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.