Print Page | Close Window

Left align text in a button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=16954
Printed Date: 17 November 2024 at 1:34am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Left align text in a button
Posted By: RedAndWhite
Subject: Left align text in a button
Date Posted: 14 July 2010 at 1:08pm
I have a Menu inside a CXTPRibbonControlSystemRecentFileList and I have been unable to get rid of the leading white space, red circle in picture bellow.  I am hoping someone here may be able to provide some insight.

The following is how the popup menu is created:

CXTPControlPopup* opControl = NULL;
if (CreateControl(oCommandBars, IDR_RECENT_SCRIPTS_MENU, ID_FILE_MRV_FILE1, opControl))
{
    lpCreateControl->pControl = opControl;
    retVal = TRUE;
}


The code I use to add the elements into the menu is as follows:

CXTPControl* opControl = oControls.Add(xtpControlButton, theRealIndex + opCmdUI->m_nID);
if (opControl)
{
    opControl->SetCaption(CString(buf) + ostrTemp);
    opControl->SetDescription(_T(""));
    opControl->SetTooltip(ostrTemp);
    opControl->SetFlags(xtpFlagManualUpdate | xtpFlagShowPopupBarTip);
}



It looks as though the button has reserved that space for an image, which is unwanted in this situation.  If I create the menu items with 'xtpControlLabel' instead of 'xtpControlButton' I get the left justification I'm looking for but I lose the look and feel of the button.  Is there some way for me to get rid of that white space?






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