Textbox contained within a frame taking focus

Posted on 2011-10-14
Last Modified: 2012-08-14
I have a VB form containing Textboxes both on the form and with a frame on the form.  The textboxes on the outside on the form follow the tab order set but after entering information in the last textbox outside the frame I want the next textbox within the frame to take the focus and it won't. even though I have code in the last textbox outside the frame to have the first textbox within the frame take the focus.
Question by:DavidH7470
    LVL 11

    Expert Comment

    Is the frame a different object model?
    LVL 29

    Accepted Solution

    you need to set the tabindex property as follows
    say you have
    contains textbox1 textbox2 textbox3
    contains textbox4 textbox5 textbox6
    and on the form
    textbox7 texbox8

    and if you need them in the following sequence you will need to set their tabindex property as follows
    Seq   control         tabindex
    0       textbox7            0
    1       textbox8            1
    2       frame1              2
    3       textbox1            0
    4       textbox2           1
    5       textbox3           2
    6       frame2             3
    7       textbox4          0
    8       textbox5          1
    9       textbox6          2

    You don't need to set focus on any item when you hit tab or enter in a textbox it will move to the next items


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
    This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
    This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    760 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

    7 Experts available now in Live!

    Get 1:1 Help Now