Print Page | Close Window

add static text to toolbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=701
Printed Date: 24 December 2024 at 8:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: add static text to toolbar
Posted By: Joe Brown
Subject: add static text to toolbar
Date 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.



Replies:
Posted By: Oleg
Date Posted: 11 May 2004 at 2:13pm
in the CommonControls you can find CControlStatic implementation.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Joe Brown
Date 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!


Posted By: amyvt
Date 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);
 
}




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net