<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Fit text to CXTPButton with image</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Fit text to CXTPButton with image]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 22 Apr 2026 10:29:22 +0000</pubDate>
  <lastBuildDate>Mon, 15 Dec 2008 10:36:40 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=12932</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Fit text to CXTPButton with image :  If I make a CXTPButton with...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12932&amp;PID=43683&amp;title=fit-text-to-cxtpbutton-with-image#43683</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2435">ibmldev</a><br /><strong>Subject:</strong> 12932<br /><strong>Posted:</strong> 15 December 2008 at 10:36am<br /><br />If I make a CXTPButton with image and text, and the text is too long to fit in the button, then the text is trunctated to fit (as expected). But, the button does not reserve space for the image. As a result, the text fills the entire width of the button and the image sits on top of the text, obscuring part of it.<br><br>It would be nice if the text were not only clipped to fit the button, but also clipped to fit the non-image portion of the button. Can this be done automatically, or do I need to somehow manually trim the text to some appropriate length when the button is resized? If I need to do it, do you have any tips to offer?<br><br>Here is the code I use to create the button:<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_btn.Create( _T( "Foo - Now is the time for all good men to come to the aid of their country." ), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | BS_PUSHLIKE, dummyRect, this, ID_LED );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_btn.SetChecked( FALSE );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_btn.SetShowFocus( FALSE );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_btn.SetBitmap( 0, IDB_RED_LED_16X16 );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_btn.SetImageAlignment( BS_VCENTER | BS_LEFT );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_btn.SetTextImageRelation( xtpButtonImageBeforeText );<br><br>This button is resized by the application when the dialog containing it is resized, so the amount of spaced available may vary after creation.<br><br>-Mark<br><br>]]>
   </description>
   <pubDate>Mon, 15 Dec 2008 10:36:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12932&amp;PID=43683&amp;title=fit-text-to-cxtpbutton-with-image#43683</guid>
  </item> 
 </channel>
</rss>