Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - add static text to toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

add static text to toolbar

 Post Reply Post Reply
Author
Message
Joe Brown View Drop Down
Newbie
Newbie


Joined: 01 March 2004
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Joe Brown Quote  Post ReplyReply Direct Link To This Post Topic: add static text to toolbar
    Posted: 07 May 2004 at 5:53pm
I have a toolbar, and want to add a slider control to it. I have it all working, but I also want to add text to the left of it that says the current position of the slider. I created a button in the toolbar as a placeholder, and in OnCreateControl, I create a CStatic and attach it to the toolbar. However, the font of the CStatic is different from everything else.

How do I get the same font? Is it possible to have a caption for any control in a toolbar? I couldn't get it to work for a CSliderCtrl.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2004 at 2:13pm
in the CommonControls you can find CControlStatic implementation.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Joe Brown View Drop Down
Newbie
Newbie


Joined: 01 March 2004
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Joe Brown Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2004 at 4:53pm
Works great! I have Toolkit Pro v8.51, and the documentation pretty much only lists member functions and variables, not actual functionality and descriptive info. Takes a lot of time to find answers on your own. Appreciate the help!
Back to Top
amyvt View Drop Down
Newbie
Newbie


Joined: 14 May 2004
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote amyvt Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2004 at 12:57pm

 another way:

 My application has "vcr" buttons in the toolbar, and text next to it "item X of Y"

 the way I do it is to create a dummy toolbar button, like you did and an UPDATE_COMMAND_UI handler.  When I update my variables, the text "updates itself".

 ON_UPDATE_COMMAND_UI(ID_DUMMY2, OnUpdateDummy2)

void CTabFrameWnd::OnUpdateDummy2(CCmdUI* pCmdUI)
{
 CString cs ;
   cs.Format("Seq %d of %-d",    m_seqnum, m_totrecs-1) ;

 // Add text to the toolbar button.
 m_wndToolBar.ModifyStyle(0, TBSTYLE_LIST) ;
 m_wndToolBar.SetButtonText(m_wndToolBar.CommandToIndex (ID_DUMMY2), cs);
 
}

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.281 seconds.