Normally the pressing of the Tab key can not trapped if there is more than one control on a form that has a TabStop set to True. The attached form demonstrates how to get around that problem.
Normally the pressing of the Tab key can not trapped if there is more than one control on a form that has a TabStop set to True. The attached form demonstrates how to get around that problem.
Do not worry about your difficulties in Mathematics. I can assure you mine are still greater.Tips, Examples & Tutorials:
Albert Einstein
A valuable forum tool Generate unique TreeView keys TreeView with "open" and "closed folder" icons Time code using GetTickCount How to trap the Tab key Scroll a form NumberBox ActiveX control Color a ListView row An InputBox form How to use SaveSetting and GetSetting A program registration scheme Spellcheck a Textbox Resize controls Open Windows Explorer at Last Visited Path A Blackjack Game Count lines of code Private Message Viewer Copy/Paste VB Code Paste VB Code Add-In Insert Procedure Names Add-In A calculator for the game of Spider My review of REALbasic 2008 VB6 Debug Tutorial Picture/Video Viewer VBF Photo Contest Winners
2009 - 2013
Just to note one thing. Before assigning the TabStop property to False, first check if the control is not Label, Image or Line. These controls don't have TabStop property because they are being painted directly on the form.
Thanks Serge. The StoreTabsStops sub in the form has the following statement:
I probably should have just included the On error Resume Next line instead of the advice.VB Code:
'Store the TabStop property for each control on the form. If you run into 'a control without a TabStop, just add an On Error Resume line
Do not worry about your difficulties in Mathematics. I can assure you mine are still greater.Tips, Examples & Tutorials:
Albert Einstein
A valuable forum tool Generate unique TreeView keys TreeView with "open" and "closed folder" icons Time code using GetTickCount How to trap the Tab key Scroll a form NumberBox ActiveX control Color a ListView row An InputBox form How to use SaveSetting and GetSetting A program registration scheme Spellcheck a Textbox Resize controls Open Windows Explorer at Last Visited Path A Blackjack Game Count lines of code Private Message Viewer Copy/Paste VB Code Paste VB Code Add-In Insert Procedure Names Add-In A calculator for the game of Spider My review of REALbasic 2008 VB6 Debug Tutorial Picture/Video Viewer VBF Photo Contest Winners
2009 - 2013
Here is another way ..
Put two textboxes on the form ..
VB Code:
Option Explicit Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer Private Const VK_TAB = &H9 Private Sub Text2_LostFocus() If GetTabState Then MsgBox "You just tabbed out of Text2" End Sub Private Sub Text1_LostFocus() If GetTabState Then MsgBox "You just tabbed out of Text1" End Sub Private Function GetTabState() As Boolean GetTabState = False If GetKeyState(VK_TAB) And -256 Then GetTabState = True End If End Function
Simple, Effective and Efficient code ...
This thread got away from what I think is appropriate for the CodeBank so rather than closing it I deleted several posts. I also edited out of techyspecy's post a quote that referred to the deleted posts. If you have concerns about my having taken this action please PM me.
Do not worry about your difficulties in Mathematics. I can assure you mine are still greater.Tips, Examples & Tutorials:
Albert Einstein
A valuable forum tool Generate unique TreeView keys TreeView with "open" and "closed folder" icons Time code using GetTickCount How to trap the Tab key Scroll a form NumberBox ActiveX control Color a ListView row An InputBox form How to use SaveSetting and GetSetting A program registration scheme Spellcheck a Textbox Resize controls Open Windows Explorer at Last Visited Path A Blackjack Game Count lines of code Private Message Viewer Copy/Paste VB Code Paste VB Code Add-In Insert Procedure Names Add-In A calculator for the game of Spider My review of REALbasic 2008 VB6 Debug Tutorial Picture/Video Viewer VBF Photo Contest Winners
2009 - 2013