Results 1 to 13 of 13

Thread: Help to an old time BASIC programmer learning VB.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    25

    Post

    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).]

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    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
    Code:
    form1.hide
    then if u want it totally gone and unloaded
    Code:
    unload form1
    hopes this helps!
    need anymore help just ask

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

  3. #3
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    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

  4. #4
    Guest

    Post

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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    25

    Post

    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

  6. #6
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    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

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    25

    Post

    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

  8. #8
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    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

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    25

    Post

    Thanks,

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

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

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    25

    Post

    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

  11. #11
    Guest

    Post

    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




  12. #12

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    25

    Post

    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

  13. #13
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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
  •  



Click Here to Expand Forum to Full Width