-
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
-
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
-
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
-
Thanks Megatron,
Should I Load/Unload or Show/Hide the About box?