<?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 : MISSING: TabControl MouseDown, KeyDown/KUp Events</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : MISSING: TabControl MouseDown, KeyDown/KUp Events]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 00:08:55 +0000</pubDate>
  <lastBuildDate>Sat, 19 Jul 2008 00:35:49 +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=11481</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[MISSING: TabControl MouseDown, KeyDown/KUp Events : I&amp;#039;ve found a work-around...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11481&amp;PID=38572&amp;title=missing-tabcontrol-mousedown-keydown-kup-events#38572</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 11481<br /><strong>Posted:</strong> 19 July 2008 at 12:35am<br /><br />I've found a work-around to accomplish the above goal (in case anyone else has a similar requirement).<br><br>In a module place this code:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer<br><br>Private Const KEY_MASK As Integer = &amp;HFF80<br><br>Public Function IsKeyDown(KeyCode As Long) As Boolean<br>&nbsp;&nbsp;&nbsp; IsKeyDown = GetKeyState(KeyCode) And KEY_MASK<br>End Function<br></pre></td></tr></table><br><br>Then, on your form with the TabControl:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Sub TabControl1_BeforeItemClick(ByVal Item As XtremeSuiteControls.ITabControlItem, Cancel As Variant)<br>&nbsp;&nbsp; If Not (IsKeyDown(vbKeyLeft) Or IsKeyDown(vbKeyRight)) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SOMEOTHERCONTROL.SetFocus<br>&nbsp;&nbsp; End If<br>End Sub<br></pre></td></tr></table><br><br>Essentially, we are checking to see if either of the cursor keys are being pressed when the TabControl is about to change the selected tab. If so, then the focus will remain on the TabControl (so the user can continue navigating the tabs with the keyboard). If not, we'll assume that the user clicked a tab with the mouse, and then move the focus to some other control where they presumably want to start typing directly.<br><br><br>]]>
   </description>
   <pubDate>Sat, 19 Jul 2008 00:35:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11481&amp;PID=38572&amp;title=missing-tabcontrol-mousedown-keydown-kup-events#38572</guid>
  </item> 
  <item>
   <title><![CDATA[MISSING: TabControl MouseDown, KeyDown/KUp Events : Control has MouseMove and MouseUp,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11481&amp;PID=38532&amp;title=missing-tabcontrol-mousedown-keydown-kup-events#38532</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 11481<br /><strong>Posted:</strong> 18 July 2008 at 12:12am<br /><br />Control has MouseMove and MouseUp, but not MouseDown. Has neither KeyUp or KeyDown events.<br><br>I would like to be able to determine if the user has switched tabs via keyboard or mouse so that I can choose whether to automatically focus a child control (mouse interaction) or not (keyboard interaction). These events would allow me to accomplish this.<br><br><br>]]>
   </description>
   <pubDate>Fri, 18 Jul 2008 00:12:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11481&amp;PID=38532&amp;title=missing-tabcontrol-mousedown-keydown-kup-events#38532</guid>
  </item> 
 </channel>
</rss>