Solved

CDialogBar in a child window

Posted on 1998-09-01
2
437 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 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