Solved

Executing 'Control + F6' in vb6 code

Posted on 2002-06-07
3
343 Views
Last Modified: 2010-05-02
hi!

I am developing a vb6 appl - i would like to move to the next form (which is behind) and would like to execute Control + F6 in code to move to the next form. How do i go about it?

Rg,
Mehul
0
Comment
Question by:melu
3 Comments
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 7061441
Any MDI application supports that key combination, so make your app an MDI
0
 
LVL 1

Expert Comment

by:Madmarlin
ID: 7061462
The sendkeys function should be able to help you, but why dont you just change the ZOrder of the form..

The ZOrder determins in which order the forms are to be sat upon one another..
0
 

Accepted Solution

by:
mikeiastate earned 50 total points
ID: 7063504
I used the following in one of my programs.  It may not be the best way, and it definately isn't very pretty, but it worked for me and I got paid for it.  It's at least a jumping off point.  

I used it to read the control mask to get out of a complex control that uses tab to move within the contol.  (The tab key was used within the contol to move from cel to cell, and I needed to use ctrl-tab to move to the next contol using set focus)  You could do the same with the form.controlname that you want to start out with focus on the new form.

***********************************************************
Private Sub vaAccounts_KeyDown(KeyCode As Integer, Shift As Integer)

    Dim CtrlDown
    Dim shiftdown
   
On Error GoTo ErrHandler

    CtrlDown = (Shift And vbCtrlMask) > 0
    shiftdown = (Shift And vbShiftMask) > 0
   
    If KeyCode = vbKeyTab Then
        If CtrlDown And shiftdown Then
            If rbMandatory = True Then
                rbMandatory.SetFocus
            Else
                If rbYes = True Then
                    rbYes.SetFocus
                Else
                    If rbNo = True Then
                    rbNo.SetFocus
                    End If
                End If
            End If
       
        Else
            If CtrlDown Then
                vaInvoices.SetFocus
            End If
        End If
    End If
   
   
   
ErrHandler:

    If Err.Number <> 0 Then
        MsgBox Err.Number & " " & Err.Description
    End If

End Sub

***********************************************************
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Computer crashes, following error message in event manager 5 199
Run code from text file in vb 1 64
Add a task in Outlook from access 11 39
Sub or Function is not defined 6 29
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question