|
-
Dec 18th, 2003, 01:36 AM
#1
Thread Starter
Addicted Member
Startup Screen
I have a startup form i.e. "splash screen" It has a checkbox and a button.
I would like to do something, but DO NOT know how.
This Startup Screen has some Information that the user don't need or "WANT" to see every time the App starts, so I thought about using the checkbox to give the user the ability to disable this Screen after the first time the App. is run.
I have a good feeling that I'm going to have to use the Registry for this one. If so would you be so kind and help me get on the rite path.
Thank you so much for your time!!!
-
Dec 18th, 2003, 01:48 AM
#2
Frenzied Member
you could use the registry but microsoft frowns upon using registry.
making ur own preference file is very easy in .net
why not make a object called Preferences that has all ur properties for settings, and serialize that to xml,
and read it back up wwhen ur app is launched
look up serializing objects, very easy i think
-
Dec 18th, 2003, 02:05 AM
#3
Thread Starter
Addicted Member
Don’t get this the wrong way, I do agree with you.
But to tell you the truth I don’t give a s… what Microsoft thinks when it comes to using My PC.
And also I think that I would like to take a stab at the Registry, I’m sure If someone is willing to give me an example that I can get this thing going.
Thanks for the reply, and I will look at what you are suggesting.
-
Dec 18th, 2003, 08:19 AM
#4
Hyperactive Member
I agree with last respondent, stay away from the registry, if necessary call it a .ini file which yoiu create and save, bit like cookies on web development. I've just been through this exercise and in the end, store the info I need on a file in the application.startuppath on the users local computer and no I don't like the solution either but it works.
His solution is much more elegant than mine.
-
Dec 18th, 2003, 09:37 AM
#5
Frenzied Member
For the registry, the RegistryKey class is part of the
Microsoft.Win32 namespace.
...do a web search.
-
Dec 18th, 2003, 09:41 AM
#6
yay gay
I also agree, stay out of the registry, it will only make your application to be more "computer dependent" against the XCopy idea of the .NET
\m/  \m/
-
Dec 18th, 2003, 11:48 AM
#7
Addicted Member
for easy access on the registry with your applications use
Code:
Application.CommonAppDataRegistry
LocalMachine\Software\ CompanyName\ ProductName\ ProductVersion
The problem with this is, when rebuilding the application u loose the settings cause he uses ProductVersion (unless version set on 1.0.0.0)
to use the registry root u want
Code:
Imports Microsoft.Win32
Private objRegRoot as RegistryKey
Sub New
objRegroot = registry.localmachine.createsubkey("SOFTWARE").createsubkey("company").createsubkey("product")
end sub
public property ShowSplash as boolean
get
return ctype(objregroot.getvalue("ShowSplash", "default"),boolean)
end get
set (byval value as boolean)
objregroot.setvalue("ShowSplash",value)
end set
end property
But i also agree its better not to use the registry.
there is an other simple way using a structure and the old fileput / fileget methods (need to put option strict off)
Code:
public structure myConfig
public ShowSplash as boolean
end structure
function ReadConfig(byval filename as string) as myConfig
dim varConfig as MyConfig
dim varFile as integer = freefile
fileopen varfile, filename, binary, read
fileget varfile, varconfig
fileclose varfile
return varconfig
end function
sub WriteConfig(byval filename as string, byval value as myConfig)
dim varFile as integer = freefile
fileopen varfile, filename, binary, read
fileput varfile, value
fileclose varfile
end sub
Greetz Nightmare
Last edited by Nigh™a®e; Dec 18th, 2003 at 11:54 AM.
-
Dec 18th, 2003, 03:57 PM
#8
Thread Starter
Addicted Member
Well who am I to argue with that many people! No Registry it is.
Thanks for all them responses. That helped.
If I’ll get it together I’m going to use .ini
Again Thanks!
VBForums Rock!
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
|
Click Here to Expand Forum to Full Width
|