Results 1 to 4 of 4

Thread: Show user's Name & ID in the About box

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458

    Wink

    Hi,
    I'm a beginning VB programmer. I'd like to add a way for my users to register my program and show the info in the About box.

    How can I keep user's 'Name' na 'Registration ID' global to the program once I read them from the registry?
    Right now I read the values from the registry EACH TIME user opens the About box. This isn't very efficient. I want to read them ONLY ONCE - when the program starts, and STORE them in some kind of global place, so when I unload a form the information doesn't get lost.

    Also what's the prefered way to close the About box: Load/Unload or Show/Hide.

    Thanx for your help.
    Tomexx

  2. #2
    Addicted Member Mih_Flyer's Avatar
    Join Date
    Mar 2000
    Location
    some place there
    Posts
    241
    ok u have to grap the info from some place, even if u stored them in a file, then u will read the file again, and i think if u use unload it's much better than just hide

  3. #3
    Guest
    Why don't you read them when the user starts the program and then copy them to a Public Variable? Then you load from the Public Variable each time you open the About Box.

    Code:
    Public UserName As String
    Public RegID As String
    Now in your Main form, load the values from the Registry using whichever method you prefer and then assign that value to UserName and RegID.

    Code:
    Private Sub Form1_Activate()
    
        ' Get values from the Registry and assign them to
        ' our Public Variables
        UserName = FunctionToGetNameFromRegistry
        RegID = FunctionToGetREGIDFromRegistry
    
    End Sub
    Now load them from these Variables in your AboutBox.

    Code:
    Private Sub frmAboutBox_Activate()
    
        ' Get the values frm the variable and display them
        lblUserName = UserName
        lblRegID = RegID
     
    End Sub

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458
    Thanks Megatron,
    Should I Load/Unload or Show/Hide the About box?

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