Results 1 to 21 of 21

Thread: Loop form start(check out # trick)(RESOLVED)

  1. #1

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Resolved Loop form start(check out # trick)(RESOLVED)

    what is the command to start the form at the very beginning when it reaches the end? or is it a loop?
    Last edited by nickTHEguitarist; Apr 8th, 2005 at 09:24 PM.
    Nick

  2. #2
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start

    Can you be more specific on what you are talking about

  3. #3

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Re: Loop form start

    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.
    Nick

  4. #4
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start

    Well then put all of these message boxes in your own sub routine. Like for example.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub MessageBox_Stuff()
    4.  
    5.     MsgBox "I'm Kool", vbExclamation
    6.     MsgBox "I'm Awesome", vbExclamation
    7.     MsgBox "I'm just freakin slick man", vbExclamation
    8.    
    9.     If MsgBox("Again?!!", vbQuestion Or vbYesNo) = vbYes Then Call MessageBox_Stuff
    10.  
    11. End Sub
    12.  
    13. Private Sub Form_Activate()
    14.  
    15.     MessageBox_Stuff
    16.    
    17.     Unload Me
    18.  
    19. End Sub

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Loop form start

    May I ask how does your program starts? Is it through Sub Main?

    VB Code:
    1. Private Sub Command1_Click
    2. Unload Me
    3. 'call the procedure taht displays your message boxes or unload then load the form that display your message boxes....
    4. End Sub
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start

    I could have suggested Sub Main() if there were to be just message boxes with the Form not being needed

    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:
    1. Option Explicit
    2.  
    3. Private Sub Main()
    4.  
    5.      'Example:
    6.  
    7.      Msgbox "Kool man!!!", vbExclamation
    8.  
    9. 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; 
    
    }

  7. #7

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Re: Loop form start

    When I created the sub routine, and i put in the form_activate, I need MessageBox_Trick() to be equal to something?
    Nick

  8. #8
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start

    Then make it a function so that it can return a value. Like for example:

    VB Code:
    1. Private Function MessageBox_Trick() As Long
    2.  
    3.     MsgBox "I'm Kool", vbExclamation
    4.     MsgBox "I'm Awesome", vbExclamation
    5.     MsgBox "I'm just freakin slick man", vbExclamation
    6.  
    7.     [b]MessageBox_Trick = 10[/b]
    8.    
    9.     If MsgBox("Again?!!", vbQuestion Or vbYesNo) = vbYes Then Call MessageBox_Trick
    10.  
    11. End Function
    12.  
    13. Private Sub Form_Activate()
    14.  
    15.      Print MessageBox_Trick
    16.      
    17.      'The output is 10 and will be viewed if vbNo is selected
    18.  
    19. End Sub

  9. #9

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Resolved Re: Loop form start

    K thanks Jacob, I got it to work now. (The first time I got a form to work from advice of this forum )
    Nick

  10. #10

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Re: Loop form start(RESOLVED)

    Check out the Number trick
    Attached Files Attached Files
    Nick

  11. #11
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start(check out # trick)(RESOLVED)

    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

    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

  12. #12

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Re: Loop form start(check out # trick)(RESOLVED)

    Ok, did you like the little trick?
    Nick

  13. #13
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start(check out # trick)(RESOLVED)

    I edited my post. Read it

    Yes I liked it.

  14. #14

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Re: Loop form start(check out # trick)(RESOLVED)

    Yes this seems to be a bit better than my program
    I'll give it a try.
    Nick

  15. #15

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Re: Loop form start(check out # trick)(RESOLVED)

    Jacob, can you figure out the math trick to my trick?
    Nick

  16. #16
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start(check out # trick)(RESOLVED)

    Yes. I remember this stuff from my ol middle school days in math class

  17. #17

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Re: Loop form start(check out # trick)(RESOLVED)

    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.
    Nick

  18. #18
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start(check out # trick)(RESOLVED)

    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:
    1. 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

    Quote Originally Posted by nickTHEguitarist
    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.
    I'll fix that. Give me 5-10 minutes... It's because of either your video card or XP

  19. #19

    Thread Starter
    Lively Member nickTHEguitarist's Avatar
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    82

    Re: Loop form start(check out # trick)(RESOLVED)

    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
    Nick

  20. #20
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start(check out # trick)(RESOLVED)

    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
    Attached Files Attached Files

  21. #21
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Loop form start(check out # trick)(RESOLVED)

    Ok the update has just been uploaded in my site.

    Besides that, did the update I gave you in that zip work?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width