+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 12

Thread: VB 6.0: Tutorial, Using the MsgBox

  1. #1
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6

    Exclamation VB 6.0: Tutorial, Using the MsgBox

    Introduction:-

    Ok, so here I will show you the basics of the MsgBox Function!

    Requirements:-
    • Visual Basic (preferibly 6.0)

    Let's begin!

    So the most basic method to display a Msgbox is:-

    Code:
    MsgBox "testing"
    This will just show a msg box with an Ok Button!

    But lets elaborate more on it:-

    Code:
    MsgBox "testing", vbOKOnly, "title"
    This will display a msgbox with a title with an Ok Button



    ok so thats the basic now lets elaborate more on out msgbox

    Code:
    msg = MsgBox("Testing", vbYesNoCancel)
    If msg = vbYes Then Print "Yes Pressed"
    If msg = vbNo Then Print "No Pressed"
    If msg = vbCancel Then Print "Cancel Pressed"
    and

    Code:
    msg = MsgBox("Testing", vbAbortRetryIgnore)
    If msg = vbAbort Then Print "Abort Pressed"
    If msg = vbRetry Then Print "Retry Pressed"
    If msg = vbIgnore Then Print "Ignore Pressed"
    Here a msg box with 3 buttons ( Yes, No, Cancel or Abort, Retry, Ignore) will be shown!
    And if you see we added "msg = " here msg ( a variable )will hold in it what button the user pressed! then we are using the if...then so to make different actions, if different buttons are pressed!



    ok now lets make an effect to our msgbox!!

    Code:
    msg = MsgBox("Testing", vbMsgBoxRtlReading + vbCritical)
    This will display a msg box Inverted! ( the other way round )
    After the "+" you can make every other type of msgbox you want and it will be inverted!!



    And there are MUCH more MsgBoxes, I gave you the basics now you can elaborate on it!!

    Ending:-
    If you have any questions/problems/feedback pls post here and I will sureley Help you!
    So I'm waiting for your feedback
    Ow and if you want me to make you some tutorials request what you want and I will see what I can do! I will be happy making some tuts here!
    Last edited by Jordan; 10-02-2006 at 11:59 AM.

  2. #2
    Newbie SlamX is an unknown quantity at this point SlamX's Avatar
    Join Date
    Feb 2007
    Posts
    1
    ty, was looking for this. +rep

  3. #3
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6
    Thanks for the +rep .

  4. #4
    Newbie nokomoli is an unknown quantity at this point
    Join Date
    Feb 2007
    Posts
    2
    Thank you

  5. #5
    Newbie Noxa is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    1
    Thanks for this, ive just started using VB and its helped alot.

  6. #6
    Learning Programmer ViRuSS will become famous soon enough ViRuSS's Avatar
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    77

    Re: VB 6.0: Tutorial, Using the MsgBox

    thx i just needed a little help with msgbox

  7. #7
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: VB 6.0: Tutorial, Using the MsgBox

    For anyone using VB.NET, I would advise the MessageBox.Show() function over MsgBox() any day.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  8. #8
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,022
    Blog Entries
    1

    Re: VB 6.0: Tutorial, Using the MsgBox

    Doesn't this tutorial apply to VB.NET also?
    "Whenever you remember, I'll be there/
    Remember how we reached that dream together" - Carrie Underwood

  9. #9
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: VB 6.0: Tutorial, Using the MsgBox

    Yes, but the MsgBox() function is an old overhand of VB6, so in all cases MessageBox.Show() should be used instead in .NET. This applies to all .NET languages.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  10. #10
    Newbie AcroneShadow is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    16

    Re: VB 6.0: Tutorial, Using the MsgBox

    very good, thanks for the post

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. VB 6.0: Tutorial, Making a Port Scanner
    By TcM in forum VB Tutorials
    Replies: 119
    Last Post: 08-24-2009, 02:59 PM
  2. Replies: 18
    Last Post: 07-08-2009, 03:55 PM
  3. VB 6.0: Tutorial, How to Make Glass2K!!
    By TcM in forum VB Tutorials
    Replies: 17
    Last Post: 05-01-2009, 06:31 AM
  4. VB 6.0: Tutorial, Explaining the VB 6.0 GUI
    By TcM in forum VB Tutorials
    Replies: 1
    Last Post: 05-18-2007, 10:25 AM
  5. John's Java Tutorial Index
    By John in forum Java Tutorials
    Replies: 0
    Last Post: 01-11-2007, 03:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts