Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Executing 'Control + F6' in vb6 code

Posted on 2002-06-07
3
Medium Priority
?
375 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 150 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

604 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