Print Page | Close Window

How to set toolbar' button caption is left aligne

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=13247
Printed Date: 20 July 2025 at 1:55am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to set toolbar' button caption is left aligne
Posted By: siwen
Subject: How to set toolbar' button caption is left aligne
Date Posted: 23 January 2009 at 9:52pm
How to set toolbar' any button  caption is left aligned and font style, and disviable any btn's tooltip.  thks



Replies:
Posted By: Oleg
Date Posted: 26 January 2009 at 2:08am
Hi,
They have to be left aligned by default.


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


Posted By: siwen
Date Posted: 26 January 2009 at 7:19am
thk for your response. but it's not,  my code is:
int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
{
        CXTPControlButton* pButton = (CXTPControlButton*)CXTPControlButton::CreateObject();
        lpCreateControl->pControl = pButton;
        pButton->SetID(lpCreateControl->nID);
        pButton->SetIconId(ID_TOOLBAR_BTN_TEST_STR);
        pButton->SetStyle(xtpButtonCaption);
        pButton->SetFlags(pButton->GetFlags() | xtpFlagControlStretched );
        pButton->SetPrompt("TestString");
}

But "TestString" is center aligned, no left aligned



Posted By: Oleg
Date Posted: 26 January 2009 at 3:13pm
Hi,
Right - with xtpFlagControlStretched will be center aligned :( if you will add also icon will be left.


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


Posted By: siwen
Date Posted: 26 January 2009 at 10:41pm
isee, but i don't want have icon.


Posted By: Oleg
Date Posted: 27 January 2009 at 1:27am
Hi,
 
Can only suggest then create class derived from CXTPControlButton, override its OnDraw and manually draw caption.


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



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