<?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 : Changing text from within CommandBarKeyDown()</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Changing text from within CommandBarKeyDown()]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 14 Jun 2026 16:29:42 +0000</pubDate>
  <lastBuildDate>Tue, 06 Jan 2009 14:22:25 +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=13018</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[Changing text from within CommandBarKeyDown() :    oleg wrote:Thanks for share...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=44217&amp;title=changing-text-from-within-commandbarkeydown#44217</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3379">DDTech</a><br /><strong>Subject:</strong> 13018<br /><strong>Posted:</strong> 06 January 2009 at 2:22pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by oleg" alt="Originally posted by oleg" style="vertical-align: text-bottom;" /> <strong>oleg wrote:</strong><br /><br />Thanks for share this :)</td></tr></table><br><br>My pleasure. Thank You for the hint<br><br>regards <br><br>Frank<br>]]>
   </description>
   <pubDate>Tue, 06 Jan 2009 14:22:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=44217&amp;title=changing-text-from-within-commandbarkeydown#44217</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text from within CommandBarKeyDown() : Hi, Thanks for share this :) ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=44110&amp;title=changing-text-from-within-commandbarkeydown#44110</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13018<br /><strong>Posted:</strong> 05 January 2009 at 2:53am<br /><br />Hi,<DIV>Thanks for share this :)</DIV>]]>
   </description>
   <pubDate>Mon, 05 Jan 2009 02:53:00 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=44110&amp;title=changing-text-from-within-commandbarkeydown#44110</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text from within CommandBarKeyDown() :  Oleg,  oleg wrote:Yes Text...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=43942&amp;title=changing-text-from-within-commandbarkeydown#43942</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3379">DDTech</a><br /><strong>Subject:</strong> 13018<br /><strong>Posted:</strong> 27 December 2008 at 9:28am<br /><br />Oleg,<br><br><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by oleg" alt="Originally posted by oleg" style="vertical-align: text-bottom;" /> <strong>oleg wrote:</strong><br /><br />Yes Text property is locked when user edit item. :( You can replace text with SetWindowText API + <font face="Courier New">CommandBar.SelectedControl.Hwnd.</font></td></tr></table><br><br>Great, thanks a lot. In my case it's a ComboBox that does not have the hWnd-Property but it works with .EditHandle. <br><br>This is the way it works for me; in case someone else needs something alike (Code is VFP9 SP2). There is an additional text-control on the form that is the reference for the current date and performing several tasks. This of course is not needed for the functionality itself.<br><br><font size="2" color="#006633" face="Courier New, Courier, mono">PROCEDURE CommandBarKeyDown(CommandBar as object, KeyCode as Long, shift as Integer) as VOID<br>&nbsp;&nbsp;&nbsp; LOCAL ldX, lnID<br><br>&nbsp;&nbsp;&nbsp; lnID = Commandbar.BarID<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; *================================================*<br>&nbsp;&nbsp;&nbsp; *&nbsp; Das funktioniert leider nicht so, wie ich es&nbsp; *<br>&nbsp;&nbsp;&nbsp; *&nbsp; mir vorstelle. Die TextBox wird aktualisiert&nbsp; *<br>&nbsp;&nbsp;&nbsp; *&nbsp; aber Text des Datums-Controls bleibt gleich&nbsp;&nbsp; *<br>&nbsp;&nbsp;&nbsp; *================================================*<br><br>&nbsp;&nbsp;&nbsp; do case<br>&nbsp;&nbsp;&nbsp; case lnID == 1094 &amp;&amp; Planung <br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if Commandbar.SelectedControl.ID = 1101 &amp;&amp; Datum<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ldX = {//}<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; do case<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case KeyCode = 38&nbsp; &amp;&amp; Up<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ldX = thisform.txtDatum.Value - 1<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case KeyCode = 40&nbsp; &amp;&amp; down<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ldX = thisform.txtDatum.Value + 1<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case Keycode = 33&nbsp;&nbsp;&nbsp; &amp;&amp; pgUp<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ldX = goMonth(thisform.txtDatum.Value, -1)&nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case Keycode = 34&nbsp;&nbsp;&nbsp; &amp;&amp; pgDown<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ldX = goMonth(thisform.txtDatum.Value, +1)<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; other<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *DEBUGOUT keycode<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; endcase&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ! empty(ldX)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *-- Control's Text is locked. So I can't set<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *-- CommandBar.SelectedControl.Text= dtoc(ldX)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *-- but it works with SetWindowText()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; declare integer SetWindowText in User32.dll&nbsp; AS SWT long hWnd, string Text<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SWT(CommandBar.SelectedControl.EditHandle, dtoc(ldX))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; thisform.txtDatum.Value = ldX<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; clear Dlls SWT<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; endif<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; endif<br><br>&nbsp;&nbsp;&nbsp; other<br>&nbsp;&nbsp;&nbsp; endcase<br><br>ENDPROC</font><br><br><br>Regards from Berlin<br><br>Frank<br><br><br>]]>
   </description>
   <pubDate>Sat, 27 Dec 2008 09:28:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=43942&amp;title=changing-text-from-within-commandbarkeydown#43942</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text from within CommandBarKeyDown() : Hi,  Yes Text property is locked...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=43933&amp;title=changing-text-from-within-commandbarkeydown#43933</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13018<br /><strong>Posted:</strong> 26 December 2008 at 4:27pm<br /><br /><DIV>Hi,</DIV><DIV>&nbsp;</DIV><DIV>Yes Text property is locked when user edit item. :( You can replace text with SetWindowText API + <FONT face="Courier New">CommandBar.SelectedControl.Hwnd.</FONT></DIV>]]>
   </description>
   <pubDate>Fri, 26 Dec 2008 16:27:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=43933&amp;title=changing-text-from-within-commandbarkeydown#43933</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text from within CommandBarKeyDown() : Hi, I am trying to change an edit-...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=43924&amp;title=changing-text-from-within-commandbarkeydown#43924</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3379">DDTech</a><br /><strong>Subject:</strong> 13018<br /><strong>Posted:</strong> 26 December 2008 at 12:13pm<br /><br />Hi, <br><br>I am trying to change an edit- or comboBoxControl's text from within the CommandbarKeyDown() - event.<br><br>The control shows a datevalue and I would like to allow the user to also change the date with the up and down keys. the event fires nicely and I am updating a second control on the form with no problem. The text of the control however does not change at all.<br><br>I do something like<br><br><font face="Courier New, Courier, mono">do case<br>case CommandBar.BarID=1094 and CommandBar.SelectedControl.ID=1101<br>&nbsp;&nbsp;&nbsp; do case<br>&nbsp;&nbsp;&nbsp; case KeyCode = 38 &amp;&amp; UpArrow<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CommandBar.SelectedControl.Text = ...<br>&nbsp;&nbsp;&nbsp; case KeyCode = 40 &amp;&amp; DnArrow<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CommandBar.SelectedControl.Text = ...<br>&nbsp;&nbsp;&nbsp; ...</font><br><br><br>I also tried to employ external timers as well as the update() event but it seems that changing the text is not possible as long as the control has the focus. <br><br>Any Tips?<br><br>thanks in advance<br><br>Frank<br><br><br>]]>
   </description>
   <pubDate>Fri, 26 Dec 2008 12:13:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13018&amp;PID=43924&amp;title=changing-text-from-within-commandbarkeydown#43924</guid>
  </item> 
 </channel>
</rss>