Solved

Executing 'Control + F6' in vb6 code

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA color chart bars 12 79
Help with retrieving partial value from a column using VB.NET 4 44
VB6 ListBox Question 4 34
fso.FolderExists("\\server\HiddenFolder$") 4 52
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

863 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

26 Experts available now in Live!

Get 1:1 Help Now