tabbed forms


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: tabbed forms

  1. #1
    Naveen K Thalanki Guest

    tabbed forms


    Hi Tim

    Please excuse if this is not relevant to the topic. I just could not avoid
    the temptation of asking a pro.

    I want to develop a tabbed form , for eg. the network properties box in Windows
    NT has tabs called 'identification','services','protocols','adapters', etc.Clicking
    on any tab changes the appearance of the rest of the form to focus exclusively
    on topic in the tab.

    Any thoughts on how I could implement this as simply as possible in VB Enterprise
    edition 6.

    Thanks in advance
    Naveen
    Share on Google+

  2. #2
    Tim Patrick Guest

    Re: tabbed forms


    I cover the implementation you describe in The Visual Basic Style Guide, on
    pages 321 through 323, with code samples. Basically, you want to add a TabStrip
    conrol to your form (part of the "Microsoft Windows Common Controls 6.0"
    component), configure its tabs through its Property Page, then add enough
    PictureBox controls for each of the tabs you will have. Make all but the
    first PictureBox invisible by default. I like to keep the border for the
    PictureBoxes turned on during development, and tile them to make them easy
    to work with. Then, in my Form_Load event, I turn off the border and reposition
    them all to match the upper-left-most PictureBox. You can put the PictureBoxes
    in a control array if you wish, or you can name the separately. Just be
    sure to either give them meaningful names, or create a meaning set of constants/enum
    for referencing the elements of the control array in code.

    Once you have added your controls to your PictureBoxes, add the code to the
    tabActive_Click event that correctly hides and shows the PictureBoxes based
    on the value of the TabStrip's SelectedItem.Index property. You should also
    add the appropriate code to the Form_KeyDown event to enable tab selection
    via the Ctrl+Tab and Shift+Ctrl+Tab key combinations.

    To make your user's life easier, make sure you correctly tab-order all controls
    on all pages of your form. Set the TabStop property of the PictureBoxes
    to False, and set the TabIndex of the TabStrip itself to appear last in the
    tab order (after any OK or Cancel buttons you may have). As I mentioned
    before, there are complete code samples in my book for this implementation.

    VB6 also includes a "Microsoft Tabbed Dialog Control 6.0 (SP3)" component.
    This version simplifies the process by allowing you to place controls directly
    on the tab pages. However, you should use the Windows Common Control version
    instead as it is more consistent with other applications.

    -----
    Tim Patrick
    tim@vbstyleguide.com

    Share on Google+

Similar Threads

  1. Forms in a TabControl
    By WEB1110 in forum .NET
    Replies: 0
    Last Post: 08-19-2002, 09:03 PM
  2. Replies: 2
    Last Post: 02-21-2002, 06:28 AM
  3. Problem in Access 97 Using Forms and Sub Forms
    By Barend Esterhuizen in forum VB Classic
    Replies: 1
    Last Post: 06-16-2000, 05:39 AM
  4. Re: Using VB forms in Outlook
    By Brian Weiss in forum Enterprise
    Replies: 1
    Last Post: 04-05-2000, 09:34 PM
  5. Submit multiple forms together from a page
    By Ashu Mahajan in forum Web
    Replies: 0
    Last Post: 03-30-2000, 02:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center