|
-
Nov 19th, 1999, 02:30 PM
#1
Thread Starter
Junior Member
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).]
-
Nov 19th, 1999, 04:57 PM
#2
So Unbanned
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
-
Nov 19th, 1999, 07:58 PM
#3
Guru
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
-
Nov 20th, 1999, 02:43 AM
#4
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).
-
Nov 20th, 1999, 03:30 AM
#5
Thread Starter
Junior Member
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
-
Nov 21st, 1999, 01:20 AM
#6
-
Nov 21st, 1999, 01:40 AM
#7
Thread Starter
Junior Member
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
-
Nov 21st, 1999, 01:50 AM
#8
Guru
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
-
Nov 21st, 1999, 03:12 AM
#9
Thread Starter
Junior Member
Thanks,
You probably helped solve a future problem. I never even thought about that difference.
------------------
Thanks,
MiDaWe
-
Nov 21st, 1999, 04:04 PM
#10
Thread Starter
Junior Member
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
-
Nov 21st, 1999, 05:27 PM
#11
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
-
Nov 21st, 1999, 06:03 PM
#12
Thread Starter
Junior Member
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
-
Nov 21st, 1999, 07:48 PM
#13
Guru
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
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
|