Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change Title Bar

Status
Not open for further replies.

stefee

Programmer
Aug 25, 2000
12
0
0
US
I want to use one module for different things. Say for instance that you have an Order Form and a Detail Form. You can select either one of these by the menu option. (Remember: they are the same module/project). I want to display the 'Order' or 'Detail' in the top most title bar depending on what they selected. How do I change that to show which one the user selected from the menu? I did try putting a variable in the string table but then it prints the actual variable word not the value.

[sig][/sig]
 
Check out the SetWindowText function. It allows you to change the title bar text. [sig][/sig]
 
If your application is MDI:
Override PreCreateWindow like so:

BOOL CMainFrame::preCreateWindow(CREATESTRUCT& cs)
{
cs.style &= (~(FWS_ADDTOTITLE | FWS_PREFIXTITLE));
return CFrameWnd::preCreateWindow(cs);
}

then, make your own title text string and set it using SetWindowText();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top