Solved

CDialogBar in a child window

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
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…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

815 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

11 Experts available now in Live!

Get 1:1 Help Now