-
Hey,
I was a pretty good BASIC programmer for 14 years. But, now I'm trying to learn Visual Basic. I know that I'm behind the times, give me a break, at least I'm tryin' to get with it. I've got my copy of Visual BASIC 6. But, I'm having trouble using forms.
I'd greatly appreciate any help even though my question may seem too simple. So, here's my question:
(it's about time : )
1) How do I change forms while my program is running. I have a cmdbutton on my form that is supposed to open a second form with additional information for the user, but I can't find the code to make the second form open up.
That's it for now. Please help me.
Thanks,
MiDaWe
[This message has been edited by MiDaWe (edited 11-20-1999).]
-
I once had this problem... when I first got vb and just after learning basic I was using print (thinking it'ld msgbox).
To show another form just type
Code:
form1.show
load form1
to hide type
then if u want it totally gone and unloaded hopes this helps!
need anymore help just ask
------------------
DiGiTaIErRoR
-
Form1.Show
Load Form1
What's the second line for? It's not necessary...
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
AIM: RYoni69
-
yeah, yonatan's right. Or at least the lines of code should be the other way around (that would enable you to re-load an unloaded form).
-
Hey guys,
Thanks, It works great. That was the only stump in my first Visual Basic project. I'm building a small frontend for a video game. It will allow a user to enter difficulty settings 'n' stuff : )
Yeah, it's simple but a good first VB project.
Thanks again for you help and I deffinitly aplaud the quickness and general good manor of this BB.
Thanks,
MiDaWe
-
You just started to learn VB and already programming a multi-form application?
Is it my imagination, or is VB just too simple???
And if it is too simple, answer my question for a change... :)
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
AIM: RYoni69
-
Yeah,
Visual Basic seems easy enough : )
I just started to program my first Visual Basic project a few days ago, and not only is it multiform but it's very near finished.
What helps most is that I already know how to program I just needed, basically : ), to learn to apply BASIC to a windows environment.
------------------
Thanks,
MiDaWe
-
Ok - if you programmed in Basic and are now programming in Visual Basic then you need to be aware of the color situation...
Basic: Color = 4 ' Red
VB: Color = 4 ' Totally almost complete black
To apply Red in VB:
Color = QBColor(4)
Color = vbRed
Color = RGB(Red:=255, Green:=0, Blue:=0)
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
AIM: RYoni69
-
Thanks,
You probably helped solve a future problem. I never even thought about that difference.
------------------
Thanks,
MiDaWe
-
I wanted to add a splash screen to my app. I want the Form1 and frmsplash to both launch at the same time when the user executes the program.
Can anyone help me?
------------------
Thanks,
MiDaWe
-
You could load it in the Form_Load of Form1
Private Sub Form_Load()
frmSplash.Show
'Do stuff
Unload frmSplash
End Sub
Or use Sub Main as startup and load both forms in there(project properties-> startup object -> sub main)
Then make a sub in a module called sub main.
Private Sub Main()
frmSplash.Show
Load Form1
'Do Stuff
Form1.Show
Unload frmSplash
End Sub
------------------
Vincent van den Braken
EMail: [email protected]
ICQ: 15440110
Homepage: http://www.azzmodan.demon.nl
-
Thanks it works great now.
How can I make the frmsplash load on top?
And, how do I add a timer that will close the frmsplash after a few seconds?
------------------
Thanks,
MiDaWe
-
Use SUB_MAIN in a module to load your app (you will also have to specify this in your project properties -- SUB_MAIN as 'Startup Object')
Sub_Main()
frmSplash.Show
doevents
'do other loadup stuff here
frmSplash.hide
frmMain.show
unload frmsplash
HTH
Tom