Click here to Skip to main content
6,915,647 members and growing! (22,081 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.
VB.NET1.1, Win2K, WinXP, WinForms, VS.NET2003, Dev
Posted:4 Nov 2005
Updated:17 Dec 2008
Views:27,384
Bookmarked:37 times
printPrint Friendly   add Share
      Discuss Discuss   Broken Article?Report  
6 votes for this article.
Popularity: 1.70 Rating: 2.18 out of 5
2 votes, 33.3%
1
2 votes, 33.3%
2

3
1 vote, 16.7%
4
1 vote, 16.7%
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.

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


Member
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
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 12 of 12 (Total in Forum: 12) (Refresh)FirstPrevNext
GeneralNot very good :( PinmemberAnt210012:43 27 Feb '10  
GeneralLoading of values Pinmemberbn2vs6:35 15 Dec '08  
GeneralRe: Loading of values PinmemberGreg Osborne7:53 15 Dec '08  
GeneralRe: Loading of values Pinmemberbn2vs12:38 17 Jan '09  
GeneralRe: Loading of values PinmemberGreg Osborne3:28 19 Jan '09  
GeneralOk ... what's wrong? PinmemberSean366:53 26 Oct '06  
QuestionConversion to VS2005 Pinmemberbrucik19:29 23 Jul '06  
General... more broken things Pinmembervanco9:26 20 Nov '05  
GeneralRe: ... more broken things PinmemberGreg Osborne4:45 21 Nov '05  
AnswerRe: ... more broken things PinmemberGreg Osborne5:40 21 Nov '05  
GeneralBroken solution Pinmembervanco9:19 20 Nov '05  
GeneralBroken Images PinmemberThe_Mega_ZZTer17:46 4 Nov '05  

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

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

PermaLink | Privacy | Terms of Use
Last Updated: 17 Dec 2008
Editor: Sean Ewington
Copyright 2005 by Greg Osborne
Everything else Copyright © CodeProject, 1999-2010
Web17 | Advertise on the Code Project