Solved

CDialogBar in a child window

Posted on 1998-09-01
2
412 Views
Last Modified: 2013-11-19
Does anyone know how to create a dialog bar in a child window of a mdi application?
0
Comment
Question by:Coma
2 Comments
 
LVL 3

Expert Comment

by:danny_pav
ID: 1321560
Having never done this, I would suggest you do the same thing you would do to put a CDialogBar in the SDI Frame Window or MDI Parent and do that to the MDI Child Window.
0
 
LVL 1

Accepted Solution

by:
elf_k earned 100 total points
ID: 1321561
try something like this:

class CScriptFrame : public CMDIChildWnd
{
//...
protected:
    CScriptBar m_ScriptBar; // CDialogBar-derived
}

BOOL CScriptFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// this prevent incorrect redraw in some cases
      cs.style|=WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
      return CMDIChildWnd::PreCreateWindow(cs);
}

int CScriptFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if(CMDIChildWnd::OnCreate(lpCreateStruct)==-1)
         return -1;
    m_ScriptBar.Create(this,IDD_SCRIPTBAR,CBRS_TOP,IDD_SCRIPTBAR);
    m_ScriptBar.SetBarStyle(
            m_ScriptBar.GetBarStyle() & ~(CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT)
            );
    return 0;
}

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now