<?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 : Is there a SizeToContent function?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : Is there a SizeToContent function?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 04:26:27 +0000</pubDate>
  <lastBuildDate>Thu, 29 Oct 2020 23:32:45 +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=24079</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[Is there a SizeToContent function? : You could probably write your...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24079&amp;PID=77916&amp;title=is-there-a-sizetocontent-function#77916</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9372">dbrookes</a><br /><strong>Subject:</strong> 24079<br /><strong>Posted:</strong> 29 October 2020 at 11:32pm<br /><br /><div>You could probably write your own, something like this:</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div>void FitToContent(CXTPButton *pwndButton, CSize szMax)<br>&nbsp; {<br>&nbsp; if (pwndButton-&gt;GetSafeHwnd())<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; CXTPMarkupUIElement *pUIElement = pwndButton-&gt;GetMarkupUIElement();<br>&nbsp;&nbsp;&nbsp; if (pUIElement)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Measure markup UI elementw ith max size limits and get the measured desired size.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CSize sz = XTPMarkupMeasureElement(pUIElement, szMax.cx, szMax.cy);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Resize the button window.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwndButton-&gt;SetWindowPos(NULL, 0, 0, sz.cx, sz.cy, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Not a markup enabled button...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br></div><div></pre></td></tr></table></div><div><br></div><div>I've done similar things to resize a markup list box window if the item text is too long due to the language changing. With a button though there may be borders to deal with as well?<br></div><div><br></div><div>Regards,</div><div>Daniel.<br></div>]]>
   </description>
   <pubDate>Thu, 29 Oct 2020 23:32:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24079&amp;PID=77916&amp;title=is-there-a-sizetocontent-function#77916</guid>
  </item> 
  <item>
   <title><![CDATA[Is there a SizeToContent function? : hello,perhaps I oversee something...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24079&amp;PID=77896&amp;title=is-there-a-sizetocontent-function#77896</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9447">Jadduni</a><br /><strong>Subject:</strong> 24079<br /><strong>Posted:</strong> 12 October 2020 at 7:29am<br /><br /><div>hello,</div><div>perhaps I oversee something here. I'm new to the toolkit, playing with the markup enabled buttons. <br></div><div>Is there any FitToContent function, that will resize the button to 100% of the markup content?</div><div><br></div><div>I can see the scaling function on the markup content, but how can I scale the button to fit the markup at 100%.</div><div><br></div><div>Thanks</div><div>Didi<br></div>]]>
   </description>
   <pubDate>Mon, 12 Oct 2020 07:29:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24079&amp;PID=77896&amp;title=is-there-a-sizetocontent-function#77896</guid>
  </item> 
 </channel>
</rss>