Solved

How to remove title bar of a window through code?

Posted on 2002-07-05
2
301 Views
Last Modified: 2013-11-20
I am developing an MDI application in Visual C++ 6.0 and I want to remove the title bar of the child windows. I am using CFormView as my View class. I have inserted a chart on the form and when I double click the form I want to hide the title of the window. Similarly when I double click the chart second time I want to show the title bar again.

I have tried ModifyStyle function but it doesnt work. Please help me out.
0
Comment
Question by:UsmanQ
2 Comments
 
LVL 12

Accepted Solution

by:
migel earned 100 total points
ID: 7131646
Hi!
IMHO you try change style on the wrong window
here is example how to switch caption mode for MDI child window from the view:


void CMfcieView::OnHideCaption()
{
     // TODO: Add your command handler code here
     CFrameWnd* pFrame = GetParentFrame();
     if (pFrame)
          {
          DWORD dwStyle = pFrame->GetStyle();
          if (dwStyle & WS_CAPTION)
               pFrame->ModifyStyle(WS_CAPTION, 0, SWP_DRAWFRAME);
          else
               pFrame->ModifyStyle(0, WS_CAPTION, SWP_DRAWFRAME);
          }
}
0
 

Author Comment

by:UsmanQ
ID: 7136826
Thanks migel that solved my problem. It workd fine.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Smart Camera scanning and reading information 3 106
firstChar challenge 13 115
Change to event 1 114
Bartender label printing - switch on and off graphics 3 40
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question