CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Toolbar

  1. #1
    Join Date
    Mar 1999
    Posts
    6

    Toolbar



    How can use a toolbar in modal dialog box.

    I tried to do in that way:

    I created a toolbar resource using Resource View with ID IDR_TOOLBAR1

    After that declared

    CToolBar* m_pTools;

    in the dialog class.

    After that in the constructor of the dialog

    m_pTools = new CToolBar();

    and in the OnCreate method of the modall dialog added this

    m_pTools->Create(this, WS_VISIBLE | WS_CHILD | CBRS_TOP, IDR_TOOLBAR1);

    m_pTools->LoadToolBar(IDR_TOOLBAR1);

    When debug the application the toolbar is created correctly, because Create and LoadToolBar return 1. But the problem is that it's not on the dialog.


    Please if anyone can help?



  2. #2
    Join Date
    Mar 1999
    Posts
    9

    Re: Toolbar



    You can search in this message board. Someone had posted the same question.

  3. #3
    Join Date
    Jun 1999
    Posts
    12

    Re: Toolbar

    hai..
    in the create instead of passing this get the handle to the dialog box and pass it iam also beginner..iam not sure wether this works....
    with best regards
    murthy


  4. #4
    Join Date
    Jul 1999
    Posts
    19

    Re: Toolbar

    Your toolbar is created with no problems, but yet, it stays invisible.
    This is because you did not tell it were to position itself.
    Just call SetWindowPos or MoveWindow for your toolbar, with the correct location on your dialog, and it will be there.
    Note that you can put a static hidden control on your dialog, and use its location to position your toolbar with ease.

    J ¨

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