Solved

Executing 'Control + F6' in vb6 code

Posted on 2002-06-07
3
334 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now