Click here to Skip to main content
Licence CPOL
First Posted 4 Nov 2005
Views 33,740
Downloads 196
Bookmarked 41 times

Reusable Application Options Dialog

By | 17 Dec 2008 | Article
A component to add a reusable Options dialog to your application.

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.

Updated

12/15/2008 - Code has been updated to .NET Framework 3.5

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

Web Developer
American Equity Insurance
United States United States

Member

Visual Basic Developer since version 1.0
Java web developer
Currently developing in vb and c#

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralNot very good :( PinmemberAnt210011:43 27 Feb '10  
GeneralLoading of values Pinmemberbn2vs5:35 15 Dec '08  
GeneralRe: Loading of values PinmemberGreg Osborne6:53 15 Dec '08  
GeneralRe: Loading of values Pinmemberbn2vs11:38 17 Jan '09  
GeneralRe: Loading of values PinmemberGreg Osborne2:28 19 Jan '09  
QuestionOk ... what's wrong? PinmemberSean365:53 26 Oct '06  
QuestionConversion to VS2005 Pinmemberbrucik18:29 23 Jul '06  
General... more broken things Pinmembervanco8:26 20 Nov '05  
GeneralRe: ... more broken things PinmemberGreg Osborne3:45 21 Nov '05  
AnswerRe: ... more broken things PinmemberGreg Osborne4:40 21 Nov '05  
GeneralBroken solution Pinmembervanco8:19 20 Nov '05  
The supplied solution is broken. It cannot find the referenced projects. But, nothing that some Notepad editing won't cure Smile | :)

GeneralBroken Images PinmemberThe_Mega_ZZTer16:46 4 Nov '05  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120528.1 | Last Updated 17 Dec 2008
Article Copyright 2005 by Greg Osborne
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid