Chapter 16: Text-Based Controls Visual C++ and MFC Fundamentals
- Access the CMainFrame::PreCreateWindow() method and change it as follows to
remove the unnecessary title:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
| WS_THICKFRAME | WS_SYSMENU;
cs.style &= ~FWS_ADDTOTITLE;
return TRUE;
}
- Test the application
- Return to MSVC
16.1.2..Drawn Labels.......................................................................................
There are two main types of labels you can use in your application. One type of label you
can add to a form or dialog box is to draw text. We have learned how to do this in Lesson
7.
Practical Learning: Drawing Labels
- To draw text used as a label, change the OnDraw() method of the view class as
follows: