CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    166

    How to move a toolbar?

    Hi,

    I created a standard win32 toolbar with CreateToolbarEx.
    By default, the toolbar is located at the top of the window.
    How can I move it to a different location in the window?
    I tried using MoveWindow (with the handle to the toolbar which I got from CreateToolbarEx) - but it didn't work.

    Please notice that it's a WIN32 question - not MFC!

    Thanks!
    Last edited by yaniv_av; March 26th, 2009 at 10:20 AM.

  2. #2
    Join Date
    Aug 2008
    Posts
    23

    Re: How to move a toolbar?

    Toolbars in dialog boxes can't be moved as a heads up, just so you know :].

    but in all other cases,

    Send TBN_BEGINADJUST then right after sending that send TBN_INITCUSTOMIZE. Crap, I forgot the rest, Just read up on MSDN about Toolbars, Hopefully that answers your question.

    http://msdn.microsoft.com/en-us/libr...46(VS.85).aspx

  3. #3
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: How to move a toolbar?

    TBN_BEGINADJUST and TBN_INITCUSTOMIZE are notifications sent via WM_NOTIFY message to the parent window as a result of a user action and have not to be explicitly sent from within your application.

    To see how to set the toolbar position take a look at Basic Common Control Styles, CCS_NOPARENTALIGN, CCS_BOTTOM, and so on
    Last edited by ovidiucucu; March 27th, 2009 at 09:12 AM.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

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