hi. I have a program which i have made for a term project that is due Tuesday January 23rd :S
The program is based on the game show "Deal or No Deal". As some of you may be aware the game show consists of 26 cases with different values in each case ranging from 0.01 to 1 million dollars. I am currently working on perfecting my randomization function on another forum ( randomizing array WITHOUT REPEAT) but there is also some other code i need to generate. When the game begins the user must choose which case is going to be theirs. They do this by clicking on the case command button. My dilemma is that my case command buttons all contain code for rest of the game to operate properly. I need to make it so that when the program initially starts all the command buttons operate this code
VB Code:
Private Sub Case1_Click() Case1.Top = 8880 ' moves case 1 to bottom of screen Case1.Left= 840 Case1.Enabled=False ' disable the use of this command button End Sub
This code simulates the users taking their selected case as it moves it down to the bottom of the form and disables it until the end of the game when the user checks whats in their case.
However i also need all of my command buttons to contain this code
VB Code:
Private Sub Case1_Click() Formcases.Visible=False ' closes initial form containing cases Caseval.Visible=True 'opens form that displays the randomized value of the selected case Case1.Visible= True 'wipes selected case off so that it cant be selected again End Sub
I need this code to be executed ONLY after the user has selected their case as referenced in the earlier code.
i have tried using if statements but i am not sure what the If condition should be. Input on this problem is much appreciated.




Reply With Quote