|
-
Apr 8th, 2005, 08:57 PM
#1
Re: Loop form start
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
-
Apr 8th, 2005, 09:03 PM
#2
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:
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;
}
-
Apr 8th, 2005, 09:08 PM
#3
Thread Starter
Lively Member
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?
-
Apr 8th, 2005, 09:11 PM
#4
Re: Loop form start
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
Last edited by Jacob Roman; Apr 8th, 2005 at 09:14 PM.
-
Apr 8th, 2005, 09:15 PM
#5
Thread Starter
Lively Member
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 )
-
Apr 8th, 2005, 09:24 PM
#6
Thread Starter
Lively Member
Re: Loop form start(RESOLVED)
Check out the Number trick
-
Apr 8th, 2005, 09:27 PM
#7
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
Last edited by Jacob Roman; Apr 8th, 2005 at 09:31 PM.
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
|