07-21-2005, 01:12 PM
I'm new to Visual Basic, but I've figured out everything I need to know in making my Jeopardy scorekeeper (not a Jeopardy game, but a tool in keeping score when you play along with Jeopardy on TV), except for one thing. I can't figure out how to get the score working. I have made a label in the main window, but I am not sure how to display an updating score with it. I've set the program up to where the main window is the Jeopardy board, and the clue windows are buttons. Each of those buttons pops up a dialog with three buttons: correct, no ring in, and incorrect. Now, that's another thing I'm trying to figure out- how to make the correct and incorrect buttons add and subtract to the score displayed in the main window. Also, I have a button that pops up a dialog with three buttons (correct, cancel, and incorrect) and a text box. I want the value entered in that text box to add or subtract (depending on if my answer was correct or incorrect) to the displayed score, so that I can use that feature for Daily Doubles. Lastly, when all the clue buttons have been pressed, I want the Double Jeopardy window (which will be a window just like the original window for the Jeopardy round, except with new clue values, obviously) to pop up, with the same score intact. Hopefully you guys can help me. :)
And before you all flame me for not searching to see if this topic has been covered before, I already did. However, those threads did not specifically answer my question, so that's why I made a new one. :)
07-21-2005, 08:36 PM
You should probably zip, and attach your code so we can understand what you've done, and how you're poping up the dialog.
Given you have a label to hold the score, then you could just add or subtract to it,
When you press the button to raise the dialog, it would set a value (let's say QuestionValue) to the value of that question. If you have the value on the button, then you could do
QuestionValue = Val(Command1.Caption)
On the dialog, in the correct button's click event you add to the total.
Label1.Caption = Val(Label1.Caption) + QuestionValue
In the incorrect button's click even you subtract from the total.
Label1.Caption = Val(Label1.Caption) - QuestionValue
To add the value in the textbox use
Label1.Caption = Val(Label1.Caption) + Val(Text1.Text)
You should be able to figure how to subtract, by now.
I don't see why you need a new window for Double Jeopardy, just use the same window, and set all the buttons to the new values.
07-21-2005, 10:58 PM
I get what you're saying, but I'm still kind of confused as to where to enter that info in. So, I think I'd better show you the code, lol. How exactly do I zip it, though, since I can't find the code itself in one file? Should I just attach my project file instead? :confused:
I think what would help is if I showed you a program that I'm trying to model my program to act like... http://members.fortunecity.com/chrisccc/jeopardy/jeopardy.zip
I'm trying to make it do everything that program does. I've made my own design and everything, with colors and different fonts, but I want it to do just what that program in the link above is designed to do. Hope that helps. Thanks for your help, by the way. I'd be screwed without a place like this to come to, haha. It's greatly appreciated. :)
EDIT: I went ahead and zipped the project file and attached it. Hope that's OK.
07-23-2005, 01:17 AM
Bumping this just to make sure nobody forgot about it. I'm hoping my last post made my problem clearer and easier to understand, because I'm really anxious to get this program working. :)
07-23-2005, 09:30 AM
1. I can't get anywhere with the Link, so can't see what you're trying to do.
2. You've only included the .vbproj file in you zip, which I assume is not enough (see item 3).
3. This lookes like a VB.Net project file, not Legacy Visual Basic, so your question should be posted on the VB.Net side of the forum. I'm not familiar enough with VB.Net to make suggestions, and VB.Net is different enough from VB6, I wouldn't try.
I'll ask one of the moderators to move this thread to the VB.Net side so you won't have to duplicate the post.
07-23-2005, 01:40 PM
Oh, alright, thanks. By the way, I just realized about the link not working. Stupid remote links. My bad. Here's the page that it's located on (click the download link near the top)... http://members.fortunecity.com/chrisccc/jeopardy/
One more thing that might be important. I used Visual Basic 2005 Express Edition Beta 2 to make this. Not sure if that makes a difference or not, but I thought I'd mention that anyway in case it helps.
07-25-2005, 03:54 PM
Hope my problem has not been forgotten. Still waiting for help. :(
07-26-2005, 09:19 AM
The above was a link to your exe. We cannot give you help unless you post all the source code and remove all of your exe files.
07-26-2005, 09:38 PM
Oh, alright. I couldn't get the source code for that program, because someone else made that. I was just showing you that program to give you an idea of what I wanted mine to do, but since you can't see the source code, that would be difficult. Sorry to sound like a noob, but how do I find the source code for my project? I'm sure it is in a file by itself, but I don't know where it is. :(
07-27-2005, 07:45 AM
In the Visual Studio folder that is in your documents folder (the name varies with the version), you' should be able to find the folder that has the name of your project in it. Go in it, delete all of the EXEs and DLLs, zip up that whole folder, and attach it here.
Note, if you have DLL files in the folder, you need to tell us what they are so we can reference our version.
07-27-2005, 12:15 PM
Done. The only DLL I found was called "My Project.Resources.Designer.vb.dll" and I found it two times. By the way, deleting the EXEs and DLLs won't hurt anything, right?
07-29-2005, 09:39 PM
It's been two days since the last response... just making sure this hasn't been forgotten.
07-31-2005, 05:29 PM
I wasn't able to open your project... could you re-upload it?
07-31-2005, 08:39 PM
It has to be opened in .NET 2005 (The My Project folder should indicate this, FYI)
The following line:
result = Dialog1.ShowDialog
*should* not work, since result is a string and ShowDialog returns a dialog result...
(but 2005 is watered down, though - I continue to be surprised at what you can get away with)
But, regardless, what you get probably won't be what you want.
So, instead, Dim result As DialogResult
Then, in the Dialog form, set the DialogResult value after everytime you hide the button.
And back on the Jeopardy form, you check the value of result, which should tell you which button was pressed if you gave it unique values.
08-02-2005, 12:40 AM
Ack. I believe I did everything you said, but I still can't get the score to display in the main Jeopardy form. I'm sure I screwed up somehow. This is frustrating when you're new at it, lol. Let me upload what I did, so you can tell me what I did wrong..
Oh, while I'm thinking about it, is there some way to make the clue dialog use the value that the clue is worth without having to make a clue dialog for every value? For example, if you press a $200 button, I want the clue dialog's title to be "$200 Clue", and add/subtract $200 to the score depending on what button you press. If that's too complicated for a newbie like me to understand, then don't worry about it. It probably is too complicated for me, lol. I was just trying to avoid making 30 new dialogs.
08-02-2005, 11:48 AM
See the attached. Post any questions you have about how it works. :)
I didn't do anything with the Daily Double button. I'll leave that one for you. :chuckle: ;)
08-03-2005, 12:34 AM
Wow!!! My goodness, you've done it. Thank you. Big time. :D
One minor question, though. I need to make a window for Double Jeopardy (that will be easy; I'll just copy the Jeopardy round and change the values from there), but how can I make the score carry over to the new window? Also, how can I make a new Final Jeopardy dialog open after all the clues in Double Jeopardy have been answered? Creating that dialog won't be hard, either, because I'll model it after the Daily Double window. If you could just answer that for me, my project would be complete. Man, thanks a lot for your help. :)
EDIT: I've been playing around with the Daily Double dialog, but I'm not quite sure how to get it to work. You probably figured it out already, but I want the amount entered in the text box to be added/subtracted to the score. Would you mind telling me how to do it?
08-03-2005, 06:48 AM
You can simply pass the score to the Double Jeopardy form's constructor:
Dim frm As New DoubleJeopardyRoundForm(_money)
You could also simply reuse the existing form. Relabel the buttons and you don't have to change a thing.
As for the Daily Double - I'd change the Clue Dialog form and get rid of the Daily Double button. Add a checkbox that says "Daily Double" or something and a textbox for the amount you're wagering. When you process the form check to see if the checkbox is checked and use the amount wagered instead of the question amount. This will require some changing of the ProcessAnswer function, but it's not too big a deal. If you need some help with it, let me know.
08-03-2005, 12:08 PM
I think I will need help with the Daily Double, lol. One question about the first thing you said, though. I'm not quite sure where to put that. I don't want to put it in the wrong place, so I wanted to make sure I did it right by asking you first.
08-03-2005, 01:57 PM
The code would go wherever you're displaying the Double Jeopardy form. I'd do it the other way, but that's just me. :)
08-03-2005, 03:55 PM
Oh, wait. You're saying if I copy the Jeopardy round form (redoing the values of course), the score will automatically carry over? Nice, I see now. But, I want to tell it to switch to the Double Jeopardy round form as soon as the last clue in the Jeopardy round is finished with. How do I do that?
08-04-2005, 07:16 AM
That's not exactly what I'm saying. If you're going to make another form for the Double Jeopardy round you pass it the current amount and store it as a member of the form, just as you're doing with the 1st form. The other way of doing it uses the same form for both rounds so you already have the amount.
As for switching to the Double Jeopardy round the first thing you have to consider is that the regular round may expire before every question is answered (unusual but it happens) so you need a manual way to start the 2nd round. To automatically detect you would add code to the ProcessAnswer function:
Dim ctrl As Control
Dim bRoundOver As Boolean = True
For Each ctrl in Me.Controls
If TypeOf ctrl Is Button And ctrl.Visible = True Then
bRoundOver = False
'no need to go any further
If bRoundOver Then
'show next form or reset this one for Double Jeopardy
08-04-2005, 12:16 PM
I knew about the round ending early sometimes (I'm a huge Jeopardy fan, lol), but I didn't do anything about it because I didn't think there was a way to do it. In the old Jeopardy scorekeeper I used that somebody else made, I always just used to select "no ring in" with the last few clues. So that's pretty cool that you can do that. You said I could tell it to reset the form and just use different values, though. Plus, I would want to tell it to change the text in the top right to "Double Jeopardy round" instead of "Jeopardy round". How do I do that?
Also, I think I might need your help on the Daily Double. Since that'll probably be a bit complicated, I added you on AIM, so we don't have to go back and forth by posting on this board.
08-04-2005, 02:02 PM
To end the round early you could just put a button on the form that resets everything or opens the other form, whichever way you're doing it.
The Daily Double's not that complicated. What exactly is the problem?
I rarely have my IM's open (I use Trillian for all of them :) ), so it might be difficult to get me on AIM.
08-04-2005, 03:37 PM
Remember, I'm pretty much a newbie at this, lol. So it's all pretty tricky to me. I never thought about doing a button that resets the form for Double Jeopardy, so that is a fantastic idea. The question I have, though, is how exactly do you tell it to reset the form to make it ready for Double Jeopardy? I'd rather do it that way rather than making a new form, so all I have to do is push the button and, bam, the new values (as well as "Jeopardy round" changing to "Double Jeopardy round" in the top right of the form) appear. Also, about the Daily Double; I'd rather do it the original way I was going to do it, instead of adding a Daily Double checkbox/text box to the clue dialog. I'm mostly going to use the Daily Double dialog to correct mistakes in case I press the wrong button or something, so I'd rather it stand alone. With that said, all I need to know is how to get the Daily Double dialog to add/subtract to the score. I'll have a text box in it, so all I need to know is how to tell it to use that value entered in the text box.
08-05-2005, 07:36 AM
Check out the attached to see how to reset the form and handle the daily double. There's still some things that need to be done:
Disable the Daily Double button after it's used once in regular Jeopardy and twice in Double Jeopardy
Disable the button to reset the form for Double Jeopardy after it's used
Probably other things I'm forgetting :)
08-05-2005, 01:08 PM
Nope, you didn't forget a thing. After two weeks of frustration, I have finally done it! Everything works exactly the way I want it to. Thank you to passel, Iceplug, and most importantly, you, Machaira, for helping me with this. I'd have been screwed without a place like this to come to for help, lol. I'm very appreciative of your help. :D
Whenever I decide to get creative and make another program with Visual Basic, I now have a great place to go for help. Glad I found this forum. :)