Results 1 to 8 of 8

Thread: Startup Screen

  1. #1

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134

    Question 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!!!


  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    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

  3. #3

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    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.

  4. #4
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    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.

  5. #5
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    For the registry, the RegistryKey class is part of the
    Microsoft.Win32 namespace.

    ...do a web search.

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    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/

  7. #7
    Addicted Member Nigh™a®e's Avatar
    Join Date
    Feb 2002
    Location
    Belgium
    Posts
    175
    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.

  8. #8

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    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
  •  



Click Here to Expand Forum to Full Width