Click to See Complete Forum and Search --> : Toolbar text


KRYPTYK
May 3rd, 1999, 02:13 PM
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,

Troy T
May 3rd, 1999, 05:19 PM
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

KRYPTYK
May 19th, 1999, 02:09 PM
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"