|
-
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
-
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
Similar Threads
-
Replies: 0
Last Post: 08-19-2002, 08:03 PM
-
By William R. Cousert in forum .NET
Replies: 2
Last Post: 02-21-2002, 05:28 AM
-
By Barend Esterhuizen in forum VB Classic
Replies: 1
Last Post: 06-16-2000, 04:39 AM
-
By Brian Weiss in forum Enterprise
Replies: 1
Last Post: 04-05-2000, 08:34 PM
-
By Ashu Mahajan in forum Web
Replies: 0
Last Post: 03-30-2000, 01: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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks