<?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 : Problem with dynamically created CXTButton</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Problem with dynamically created CXTButton]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 03 Apr 2026 21:52:14 +0000</pubDate>
  <lastBuildDate>Thu, 20 Dec 2007 13:41:48 +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=9147</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[Problem with dynamically created CXTButton : Mea culpa - The button was originally...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9147&amp;PID=29675&amp;title=problem-with-dynamically-created-cxtbutton#29675</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 9147<br /><strong>Posted:</strong> 20 December 2007 at 1:41pm<br /><br />Mea culpa - The button was originally subclassed from CBitmapButton. After subclassing from the CJ button, the message_map was not updated (but message handlers were updated to call the new CJ base class) so the MouseMove message never made it to CJ because the code did not have a mouse move handler.<DIV>&nbsp;</DIV><DIV>Now that I have chained the class's message map to the CJ one, everything works.</DIV>]]>
   </description>
   <pubDate>Thu, 20 Dec 2007 13:41:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9147&amp;PID=29675&amp;title=problem-with-dynamically-created-cxtbutton#29675</guid>
  </item> 
  <item>
   <title><![CDATA[Problem with dynamically created CXTButton : I have the folowing code that...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9147&amp;PID=29602&amp;title=problem-with-dynamically-created-cxtbutton#29602</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 9147<br /><strong>Posted:</strong> 19 December 2007 at 11:51am<br /><br />I have the folowing code that creates a CXTButton I am placing on a dialog:<DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>pBmpButton</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>Create</FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>NULL</FONT><FONT color=#0000ff size=2>,</FONT><FONT size=2> WS_CHILD</FONT><FONT color=#0000ff size=2>|</FONT><FONT size=2>WS_VISIBLE</FONT><FONT color=#0000ff size=2>|</FONT><FONT size=2>BS_OWNERDRAW</FONT><FONT color=#0000ff size=2>,</FONT><FONT size=2> xtpRect</FONT><FONT color=#0000ff size=2>,</FONT><FONT size=2> pDlg</FONT><FONT color=#0000ff size=2>,</FONT><FONT color=#ff0000 size=2>1</FONT><FONT color=#0000ff size=2>);</DIV><DIV></DIV><FONT size=2><P>pBmpButton</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>SetWindowText</FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>strText</FONT><FONT color=#0000ff size=2>);</P></FONT><FONT size=2><P>pBmpButton</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>SetTheme</FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>xtThemeOfficeXP</FONT><FONT color=#0000ff size=2>);</P></FONT><FONT size=2><P>pBmpButton</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>SetXButtonStyle</FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>BS_XT_WINXP_COMPAT</FONT><FONT color=#0000ff size=2>|</FONT><FONT size=2>BS_XT_HILITEPRESSED</FONT><FONT color=#0000ff size=2>);</P><DIV></DIV><P>I then add&nbsp;an icon to the button. The button displays fine.</P><DIV></DIV><DIV></DIV>My problem is that when I move over the button, it does not draw with the orange highlight and pressing does not show the blue highlight. If I remove BS_OWNERDRAW, I get the highlighting but the bitmap never shows up.<DIV>&nbsp;</DIV><DIV>What do I need to do to get the bitmap, text and highlighting all working together?</DIV><DIV>&nbsp;</DIV><DIV>By the way, as per the sample, I also have this code that simply subclasses an existing button and the highlighting works fine:</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2><P>pNewXTPBtn </FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> CXTButton</FONT><FONT color=#0000ff size=2>();</P></FONT></DIV><DIV></DIV><FONT size=2><P>pNewXTPBtn</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>SubclassDlgItem</FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>nBtnID</FONT><FONT color=#0000ff size=2>,</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>this);</P></FONT><FONT size=2><P>pNewXTPBtn</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>SetTheme</FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>xtThemeOfficeXP</FONT><FONT color=#0000ff size=2>);</P></FONT><FONT size=2><P>pNewXTPBtn</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>SetXButtonStyle</FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>BS_XT_WINXP_COMPAT</FONT><FONT color=#0000ff size=2>|</FONT><FONT size=2>BS_XT_HILITEPRESSED</FONT><FONT color=#0000ff size=2>|</FONT><FONT size=2>BS_XT_TWOROWS</FONT><FONT color=#0000ff size=2>);</P><DIV></DIV>I tried adding BS_XT_TWOROWS in the first case but that has no effect. I have also looked at the existing button for the second case in the resource editor and it only has the child and visible styles set. So other than the first button being created dynamically, I can find nothing that causes the two to display differently when the mouse moves over (or presses) the buttons.</FONT></FONT></FONT>]]>
   </description>
   <pubDate>Wed, 19 Dec 2007 11:51:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9147&amp;PID=29602&amp;title=problem-with-dynamically-created-cxtbutton#29602</guid>
  </item> 
 </channel>
</rss>