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

Thread: Toolbar text

  1. #1
    Join Date
    Apr 1999
    Posts
    3

    Toolbar text

    Hello,
    I'm using MSVC++ 5.0 and am developing an application that requires a label of text on a toolbar. An example of this is the "Address" label on the Internet Explorer address bar. Any info would be appreciated.
    Thanks,


  2. #2
    Join Date
    May 1999
    Location
    WA
    Posts
    65

    Re: Toolbar text

    Here is a link to an article that Michael Brannan wrote for the CodeGuru site. This should help you with the text problem on the toolbar.

    http://www.codeguru.com/toolbar/TextToolBar.shtml


    Good luck!

    - Troy

  3. #3
    Join Date
    Apr 1999
    Posts
    3

    Re: Toolbar text

    I found the way to do it!
    I created a dummy button and replaced it just like the combobox in the
    toolbar method. See toolbar section in codeguru for details. Replace the
    dummy button with a static control. I ec\ven found a way to change the
    font of the controls. My address bar looks like the one in IExplorer.
    See example below:

    This is in protected in Mainframe.h...
    CStatic m_AddrLabel;

    This is in OnCreate Mainframe.cpp...

    int index = 0;
    //get position of label placeholder
    while (m_wndAddressBar.GetItemID(index) != ID_ADDRBUTTON)
    index++;

    //add label to toolbar
    //m_wndAddressBar.SetButtonInfo(index, 0xffff, TBBS_SEPARATOR,
    124);

    //initialize label
    LPCTSTR label = "Address:";
    m_AddrLabel.Create( label, SS_CENTER | WS_VISIBLE, CRect(0, 6, 57,
    25), &m_wndAddressBar, 0xffff );

    //Set the font like the statusbar
    m_AddrLabel.SetFont(m_wndStatusBar.GetFont(), true);


    Nobody answered my post so I had to find the solutions myself.
    Use the same method to set the font for the label for other controls.
    Hope this helps

    Ariel Mirles "KRYPTYK"


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