Solved

Executing 'Control + F6' in vb6 code

Posted on 2002-06-07
3
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

728 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