|
-
Jan 25th, 2012, 06:16 AM
#1
Thread Starter
Member
[RESOLVED] Option butten Enabling for a game.
Ok i have a selection of classes you can chose from threw option buttens. But i am trying to make it so that the stats that the system randomly generates determines what class you can be and if the stat dosent match up then the class is disabled. The problem is that the code only works half the time. Can someone tell me what about my code isnt working? Or maybe a new code that might work.
This is my code :
Private Sub CheckStats()
'Checks Int and dex for Mage"
If Integer.Parse(lblInt.Text) >= 19 And Integer.Parse(lblDex.Text) >= 16 Then
optMage.Enabled = True
ElseIf Integer.Parse(lblInt.Text) <= 18 And Integer.Parse(lblDex.Text) <= 15 Then
optMage.Enabled = False
End If
'Checks Str for Knight'
If lblStr.Text >= Int(18) Then
optKnight.Enabled = True
ElseIf (lblStr.Text) <= Int(17) Then
optKnight.Enabled = False
End If
'Checks Con for Knight'
If lblCon.Text >= Int(18) Then
optKnight.Enabled = True
ElseIf lblCon.Text <= Int(17) Then
optKnight.Enabled = False
End If
As you can see i have tryed it in 2 differnt ways but both ways give the same results.
I have CheckStats() on my form_load and Roller_click that way it checks them as the form loads and the butten is pushed so that no one can cheat and get a class without having the stats. But as i said it only works half the time. Ty for your help. If you have any questions on it feel free to ask i might not have explained it well enough.
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
|