5,545,925 members and growing! (16,227 online)
Email Password   helpLost your password?
Languages » VB.NET » Windows Forms     Intermediate License: The Code Project Open License (CPOL)

Reusable Application Options Dialog

By Greg Osborne

A component to add a reusable Options dialog to your application.
VBWindows, .NET, .NET 1.1, Win2K, WinXPVS.NET2003, Visual Studio, Dev

Posted: 4 Nov 2005
Updated: 21 Nov 2005
Views: 20,541
Bookmarked: 24 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
4 votes for this Article.
Popularity: 1.28 Rating: 2.13 out of 5
1 vote, 25.0%
1
2 votes, 50.0%
2
0 votes, 0.0%
3
1 vote, 25.0%
4
0 votes, 0.0%
5

Sample Image - AppOptions.jpg

Introduction

Tired of recreating an Options dialog for every application you make? Using this component, you can specify a hierarchical structure in the registration database under a vendor and application specific key, and automatically read, construct, and update the settings with minimal code. Or, if you store your settings somewhere else, you can use the component in Manual mode and read and save them at your will.

A sample project and a help document is included. To add the component to the Components tab of your toolbox, compile the solution and then select the Components toolbox tab, right-click and select Add/Remove item..., then navigate to the OSSystem.ApplicationOptions.dll file, and select it.

Add the component to a form and off you go!

Registration Data

Once the VendorName and ApplicationName properties are set, the component will look in the registration database under the HKEY_CURRENT_USER\Software\<VendorName>\<ApplicationName> key for the base options key. Note the image below:

Registry Hierarchy

The Options key is the base options key. Other keys located under this are Category keys. Values within the keys are options. The options have special formatting, but don't let that bother you...the component takes care of creating and managing these for you.

There are methods on the ApplicationOptions component and the Category class to handle creating categories and options. It would behoove you to take a gander at the Help file before using the component.

Dialogs

There are two type of dialogs: Tabbed view and Tree view. A tabbed view presents hierarchical data as a set of tabs nested inside tab pages. As you can imagine, if the hierarchy gets too deep, the tabbed view loses its appeal. The tree view presents its data much like the Visual Studio Options dialog, and nesting is not a problem there since it only displays the options for one category at a time.

Many properties of the ApplicationOptions component are used to determine how the dialog will look and react. See the help file for the properties usagee and settings.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Greg Osborne


Visual Basic Developer since version 1.0
Occupation: Software Developer (Senior)
Company: Iowa Foundation for Medical Care
Location: United States United States

Other popular VB.NET articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 7 of 7 (Total in Forum: 7) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralOk ... what's wrong?memberSean366:53 26 Oct '06  
QuestionConversion to VS2005memberbrucik19:29 23 Jul '06  
General... more broken thingsmembervanco9:26 20 Nov '05  
GeneralRe: ... more broken thingsmemberGreg Osborne4:45 21 Nov '05  
AnswerRe: ... more broken thingsmemberGreg Osborne5:40 21 Nov '05  
GeneralBroken solutionmembervanco9:19 20 Nov '05  
GeneralBroken ImagesmemberThe_Mega_ZZTer17:46 4 Nov '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 21 Nov 2005
Editor: Smitha Vijayan
Copyright 2005 by Greg Osborne
Everything else Copyright © CodeProject, 1999-2008
Web07 | Advertise on the Code Project