Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Programming Interfaces (http://www.programmingforums.org/showthread.php?t=13049)

surf3rb0y Apr 24th, 2007 12:22 PM

Programming Interfaces
 
How can I make a preferences window open from my main gui to allow the user to input preference changes.

Ty

mackenga May 20th, 2007 11:11 AM

This is a really general question! If you're talking VB6 the very basic answer is to create a form which will be your preference page and set up the controls on it so it looks right, then add the code to make it work right. A tradition in VB6 is to store things like configuration options in global variables; it's not pleasant, but nothing about classic VB is really. I usually create a module for my global variables to live in to ease the pain slightly.

Then you just need to set its visibility to false initially and then Show it at the appropriate time. If it has Ok and Cancel buttons their Click handlers should set the global variables and then hide the preferences form, and just hide the preferences form, respectively.

Like I say your question is really too general but I hope this helps a bit. You can use a Tabbed Dialog control for a nice preferences page.

Oh, also, it's nice to have your application save and load settings; the cleanest way to do this is probably using the registry, but INI files are still in common use too.

I have collegues who would create a 'configuration' class, which 'encapsulates' the whole management of settings - but they're kidding themselves in my view since VB classes are not real classes anyway. I wouldn't use VB for anything big enough to warrant tidy programming - it would be too frustrating.


All times are GMT -5. The time now is 11:25 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC