what is the command to start the form at the very beginning when it reaches the end? or is it a loop?
Printable View
what is the command to start the form at the very beginning when it reaches the end? or is it a loop?
Can you be more specific on what you are talking about :ehh:
I have a program that is basically all message boxes because its a numbers trick. I've managed to figure out a random number generator (kudos to me) and it's pretty cool. But when the trick ends it goes to the form which is a smiley and a label that says "cool huh?" I want to put a command in there that says "Again?" that will go back to the first message box.
Well then put all of these message boxes in your own sub routine. Like for example.
VB Code:
Option Explicit Private Sub MessageBox_Stuff() MsgBox "I'm Kool", vbExclamation MsgBox "I'm Awesome", vbExclamation MsgBox "I'm just freakin slick man", vbExclamation If MsgBox("Again?!!", vbQuestion Or vbYesNo) = vbYes Then Call MessageBox_Stuff End Sub Private Sub Form_Activate() MessageBox_Stuff Unload Me End Sub
May I ask how does your program starts? Is it through Sub Main?
VB Code:
Private Sub Command1_Click Unload Me 'call the procedure taht displays your message boxes or unload then load the form that display your message boxes.... End Sub
I could have suggested Sub Main() if there were to be just message boxes with the Form not being needed :bigyello:
To do this all you would need is just a module, and no Form. In that module, if you have a sub routine like this:
VB Code:
Option Explicit Private Sub Main() 'Example: Msgbox "Kool man!!!", vbExclamation End Sub
Visual Basic automatically calls this sub when no form is present. Same holds true in C and C++
Code:
#include <stdio.h>
int main(void)
{
printf("Kool man!!!\n",);
return 0;
}
When I created the sub routine, and i put in the form_activate, I need MessageBox_Trick() to be equal to something?
Then make it a function so that it can return a value. Like for example:
VB Code:
Private Function MessageBox_Trick() As Long MsgBox "I'm Kool", vbExclamation MsgBox "I'm Awesome", vbExclamation MsgBox "I'm just freakin slick man", vbExclamation [b]MessageBox_Trick = 10[/b] If MsgBox("Again?!!", vbQuestion Or vbYesNo) = vbYes Then Call MessageBox_Trick End Function Private Sub Form_Activate() Print MessageBox_Trick 'The output is 10 and will be viewed if vbNo is selected End Sub
K thanks Jacob, I got it to work now. (The first time I got a form to work from advice of this forum :))
Check out the Number trick
You may wanna fix a little something there. Open your Number Trick.vbp file with notepad and look for this line:
Form=..\..\..\..\DOCUME~1\Owner\Desktop\NUMBER~1.FRM
Change that line to this:
Form=NUMBER~1.FRM
Otherwise people who are trying to open your project will get an error message. ;)
Nice beginner program. Let's step it up a notch. Try these two programs I made and uploaded in my site :bigyello:
www.angelfire.com/fl5/memorydll/index.html
The controls are these:
Mouse: Freelook
Arrow keys: moves sprite
Space: Fire (except in MKvsSF)
Numpad: Controls camera
F12: Snapshot
Esc: Exits program
Ok, did you like the little trick?
I edited my post. Read it ;)
Yes I liked it.
Yes this seems to be a bit better than my program ;)
I'll give it a try.
Jacob, can you figure out the math trick to my trick?
Yes. I remember this stuff from my ol middle school days in math class :bigyello:
Darn, well I played your game, and when I loaded it, half of the screen was white. The half that was white was in a diagonal from the top left to the bottom right. :confused:
Oh, do me a favor. Once MKvsSF is done and you unzip it, open the project. Go into the Game_Loop module. Find the Enumeration_Loop. Down to where it has DirectShow_Load_Media stuff, comment out the original line that's not commented and uncomment this:
VB Code:
DirectShow_Load_Media App.Path & "\Music\Dimmu Borgir - Death Cult Armageddon - 07 - Allehelgens Død I Helveds Rike.mp3"
I'm pretty sure that song is in the download. It get's good after a minute has passed. Heavy metal and fighting games go well together. Actually it's Norweigan Black Metal :bigyello:
I'll fix that. Give me 5-10 minutes... It's because of either your video card or XPQuote:
Originally Posted by nickTHEguitarist
Who knows, I have a pretty new Gateway computer. But my dad, who is a computer programmer himself, and my brother, who is majoring in telecommunications, set this up for me. I know as much as word and the internet :cool:
Ok replace the old source code and exe with the code/exe in this zip file and you should be all good.
Note to others: this will not work without the graphics, sounds, etc. This is mainly only for Nick here.
In the meantime, I'm gonna reupload this in my site. It should work fine now. Sorry bout that. I added a fade in/fade out feature, but didn't expect problems on other machines. So I removed it here ;)
Ok the update has just been uploaded in my site.
Besides that, did the update I gave you in that zip work?