Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - Left align text in a button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Left align text in a button

 Post Reply Post Reply
Author
Message
RedAndWhite View Drop Down
Newbie
Newbie


Joined: 14 July 2010
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedAndWhite Quote  Post ReplyReply Direct Link To This Post Topic: Left align text in a button
    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?



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.113 seconds.