|
-
May 31st, 2002, 02:46 PM
#1
Thread Starter
New Member
Message Box Fork
Im trying to get a message box to display a Yes or No question and depending on the answer, will operate a function.
Its not working properly, and I dont know why. my code is as follows:
VB Code:
Private Sub Form_Load()
Msgbox "Have you played this game before", vbYesNo, "Attention!"
If (vbMsgboxResult.vbNo = "No") Then
cmd_hack.Enabled = False
cmd_start.Enabled = False
End If
End Sub
It's giving me an error message when I press No... I think its something with the If statement... could anyone possibly help?
-
May 31st, 2002, 03:20 PM
#2
Code:
If MsgBox(...) = vbNo Then
...
Z.
-
May 31st, 2002, 03:27 PM
#3
Thread Starter
New Member
heh, I just figured it out doing it a different way.
But thanks anyways ^_^
-
May 31st, 2002, 03:30 PM
#4
Thread Starter
New Member
Actually, Im having a new problem now.
When I click yes, it performs the same function that no would do. My code is as follows.
VB Code:
Private Sub Form_Load()
MsgBox "Have you played this game before?", vbYesNo, "Attention!"
If VbMsgBoxResult.vbNo = vbNo Then
cmd_hack.Enabled = False
cmd_start.Enabled = False
Else
If VbMsgBoxResult.vbYes = vbYes Then
cmd_hack.Enabled = True
cmd_start.Enabled = True
End If
End If
End Sub
-
May 31st, 2002, 03:35 PM
#5
Remove the If statement in the Else statement.
Z.
-
May 31st, 2002, 03:38 PM
#6
Thread Starter
New Member
I have it like this now:
VB Code:
Else
VbMsgBoxResult.vbYes = vbYes
cmd_hack.Enabled = True
cmd_start.Enabled = True
Its saying the .vbYes =
"assignment to constant not permitted."
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
|