|
-
Dec 16th, 2005, 02:36 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Brains Not Working!
A VB6 Form has a Label & a CommandButton. When this application is used in the trial version mode, users can use it only 5 times. As & when the application is run, the user should be shown how many times he has already used the application in the Label. The CommandButton should be visible only when the user runs the application for the sixth time otherwise the CommandButton should always be hidden. After the user has used it 5 times, he should be shown a message in the Label saying "Trial version expired" along with the CommandButton clicking which the application should terminate. I tried it this way:
VB Code:
Option Explicit
Private Sub Form_Load()
Dim Count As Integer
Dim NumOfRuns As Integer
NumOfRuns = Val(GetSetting("VBAPP", "TRIAL", "RUNS", "0"))
NumOfRuns = NumOfRuns + 1
SaveSetting "VBAPP", "TRIAL", "RUNS", NumOfRuns
Count = GetSetting("VBAPP", "TRIAL", "RUNS")
If (Count = 1) Then
lblTrial.Caption = "You have used the trial version 1 time"
ElseIf (Count >= 2 And Count <= 5) Then
lblTrial.Caption = "You have used the trial version " & Count & " times"
ElseIf (Count > 5) Then
lblTrial.Caption = "Trial version expired"
cmdExit.Visible = True
End If
End Sub
But when the code is run from the IDE, the Form with the Label doesn't show up irrespective of the no. of times the application has been run. Where am I erring?
Please note that the key gets created in the registry successfully.
Thanks,
Arpan
ARPAN
IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!
NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!
PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?
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
|