PDA

Click to See Complete Forum and Search --> : Help to an old time BASIC programmer learning VB.


MiDaWe
Nov 19th, 1999, 01:30 PM
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).]

DiGiTaIErRoR
Nov 19th, 1999, 03:57 PM
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

form1.show
load form1
to hide type

form1.hide

then if u want it totally gone and unloaded
unload form1

hopes this helps!
need anymore help just ask

------------------
DiGiTaIErRoR

Yonatan
Nov 19th, 1999, 06:58 PM
Form1.Show
Load Form1

What's the second line for? It's not necessary...

------------------
Yonatan
Teenage Programmer
E-Mail: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
AIM: RYoni69

Nov 20th, 1999, 01:43 AM
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).

MiDaWe
Nov 20th, 1999, 02:30 AM
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

Yonatan
Nov 21st, 1999, 12:20 AM
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: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
AIM: RYoni69

MiDaWe
Nov 21st, 1999, 12:40 AM
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

Yonatan
Nov 21st, 1999, 12:50 AM
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: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
AIM: RYoni69

MiDaWe
Nov 21st, 1999, 02:12 AM
Thanks,

You probably helped solve a future problem. I never even thought about that difference.

------------------
Thanks,
MiDaWe

MiDaWe
Nov 21st, 1999, 03:04 PM
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, 04:27 PM
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: azzmodan@azzmodan.demon.nl
ICQ: 15440110 (http://www.icq.com/15440110)
Homepage: http://www.azzmodan.demon.nl

MiDaWe
Nov 21st, 1999, 05:03 PM
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

Clunietp
Nov 21st, 1999, 06:48 PM
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