<?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 : Set focus to control inside docking pane</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Docking Pane : Set focus to control inside docking pane]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 28 Apr 2026 10:19:54 +0000</pubDate>
  <lastBuildDate>Thu, 05 Nov 2009 12:52:31 +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=15149</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[Set focus to control inside docking pane :  I used to get this error seemingly...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15149&amp;PID=54599&amp;title=set-focus-to-control-inside-docking-pane#54599</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4225">chrisABC</a><br /><strong>Subject:</strong> 15149<br /><strong>Posted:</strong> 05 November 2009 at 12:52pm<br /><br />I used to get this error seemingly at random on different PCs. The problem is when the control (eg TextBox) you want to set Focus to is not visible when you try to set focus -- this gives error.&nbsp; In my apps, I think timing caused the problem to only happen sometimes (eg maybe sometimes the control is visible, sometimes it is not quite ready).<br><br>I solved this by adding a Timer to each form that needs this.&nbsp; Set the Timer to give a delay of 200 mSec or so, and in the Form_Activate (or other) event, set a module level variable to indicate which control is to get Focus.&nbsp; <br>The Form is displayed, and then the Timer fires and sets Focus to that control. (And then set the Timer off).<br><br>This can be more useful. If you have several Forms (or Panes) on screen, you can remember which control in each one had focus and set focus to it again when user returns to that form.<br>]]>
   </description>
   <pubDate>Thu, 05 Nov 2009 12:52:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15149&amp;PID=54599&amp;title=set-focus-to-control-inside-docking-pane#54599</guid>
  </item> 
  <item>
   <title><![CDATA[Set focus to control inside docking pane : I don&amp;#039;t think that this is...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15149&amp;PID=52918&amp;title=set-focus-to-control-inside-docking-pane#52918</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 15149<br /><strong>Posted:</strong> 10 September 2009 at 4:16pm<br /><br />I don't think that this is a DockingPane limitation. You can never call SetFocus methods inside the Form_Load event because the control must be visible otherwise an error will be raised (you can try this on a regular VB6 form). You can set the focus inside the Form_Activate event though (because the form is visible at this point). If you only want this to happen once, you can use a Static variable...something like:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Sub Form_Activate()<br>&nbsp;&nbsp; Static s_Activated As Boolean<br><br>&nbsp;&nbsp; If Not s_Activated Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s_Activated = True<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Me.Text1.SetFocus<br>&nbsp;&nbsp; End If<br>End Sub<br></pre></td></tr></table><br><br>]]>
   </description>
   <pubDate>Thu, 10 Sep 2009 16:16:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15149&amp;PID=52918&amp;title=set-focus-to-control-inside-docking-pane#52918</guid>
  </item> 
  <item>
   <title><![CDATA[Set focus to control inside docking pane : I have a VB6 SDI app with one...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15149&amp;PID=52915&amp;title=set-focus-to-control-inside-docking-pane#52915</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=729">tobi</a><br /><strong>Subject:</strong> 15149<br /><strong>Posted:</strong> 10 September 2009 at 12:46pm<br /><br />I have a VB6 SDI app with one docking pane !<br>At application startup I want to set the focus to the textbox inside the pane, but at the end of FORM_LOAD I receive error !<br><br>I think at this moment the docking pane isn't yet ready ?<br><br>Does anyone have idea when and where I can set focus to the textbox inside the pane?<br><br><br><br>]]>
   </description>
   <pubDate>Thu, 10 Sep 2009 12:46:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15149&amp;PID=52915&amp;title=set-focus-to-control-inside-docking-pane#52915</guid>
  </item> 
 </channel>
</rss>