CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2005
    Posts
    218

    Is it somehow possible to have a toolbar at the bottom of my cdialog?

    Is it somehow possible to have a toolbar at the bottom of my cdialog?
    I added the toolbar, but docking is not possible in cdialogs, it seems.

  2. #2
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496

    Re: Is it somehow possible to have a toolbar at the bottom of my cdialog?

    See here

    PS: Please search on Google and CG prior to posting a new question.
    Har Har

  3. #3
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Thumbs up Re: Is it somehow possible to have a toolbar at the bottom of my cdialog?

    yes with the help of CCS_BOTTAM style you can.just specify this style at the time of creation of a toolbar

    Code:
    CreateWindowEx(0,TOOLBARCLASSNAME, (LPSTR) NULL, 
    WS_CHILD|WS_OVERLAPPEDWINDOW| WS_VISIBLE | TBSTYLE_TOOLTIPS | 
    TBSTYLE_FLAT|TBSTYLE_REGISTERDROP|TBSTYLE_SEP|TBSTYLE_LIST|TBSTYL
    E_ALTDRAG| WS_BORDER|TBSTYLE_REGISTERDROP|CCS_BOTTOM , 10, 0, 
    20, 30, m_hWnd,(HMENU) NULL, _Module.GetResourceInstance(), NULL);

  4. #4
    Join Date
    Feb 2005
    Posts
    218

    Re: Is it somehow possible to have a toolbar at the bottom of my cdialog?

    Hi,

    I'm trying like in the example and with the CCS_BOTTOM style, but I can't get it done.
    Code:
    	m_Toolbar.Create(this);
    	m_Toolbar.LoadToolBar(IDR_PRECALCULATION_TOOLBAR);
    	m_Toolbar.GetToolBarCtrl().ModifyStyle(CCS_TOP,CCS_BOTTOM);
    	m_Toolbar.ModifyStyle(CCS_TOP,CCS_BOTTOM);
    	RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0,reposDefault);
    I also don't know _Module, what is it and how to use it?


    Thanks,

    timv

  5. #5
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: Is it somehow possible to have a toolbar at the bottom of my cdialog?

    Quote Originally Posted by timv
    Is it somehow possible to have a toolbar at the bottom of my cdialog?
    It is generally possible - but not recommended. Toolbars are designed to live in normal frame windows, not dialog boxes. Even if you get the docking done, you will have a lot of other issues (like command UI updating and command routing not working). Why don't you use an SDI window instead?
    Also see this FAQ.

  6. #6
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Is it somehow possible to have a toolbar at the bottom of my cdialog?

    Do this:
    Code:
    m_Toolbar.Create(this,WS_CHILD | WS_VISIBLE | CBRS_BOTTOM);
    m_Toolbar.LoadToolBar(IDR_TOOLBAR1);
    RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0,reposDefault);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured