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

Thread: VB 6.0: Tutorial, Using the MsgBox

  1. #1
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101

    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 09:59 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    SlamX Guest
    ty, was looking for this. +rep

  4. #3
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Thanks for the +rep .

  5. #4
    nokomoli Guest
    Thank you

  6. #5
    Noxa is offline Newbie
    Join Date
    Oct 2007
    Posts
    1
    Rep Power
    0
    Thanks for this, ive just started using VB and its helped alot.

  7. #6
    ViRuSS's Avatar
    ViRuSS is offline Learning Programmer
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    77
    Rep Power
    13

    Re: VB 6.0: Tutorial, Using the MsgBox

    thx i just needed a little help with msgbox

  8. #7
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    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

  9. #8
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    Re: VB 6.0: Tutorial, Using the MsgBox

    Doesn't this tutorial apply to VB.NET also?

  10. #9
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    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

  11. #10
    AcroneShadow is offline Newbie
    Join Date
    Dec 2008
    Posts
    16
    Rep Power
    0

    Re: VB 6.0: Tutorial, Using the MsgBox

    very good, thanks for the post

+ Reply to Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MASM display a number in msgbox
    By 7marco08 in forum Assembly
    Replies: 8
    Last Post: 08-14-2011, 01:45 PM
  2. MASM display a number in msgbox
    By 7marco08 in forum Assembly Tutorials
    Replies: 8
    Last Post: 08-14-2011, 01:45 PM
  3. JavaScript:Tutorial, Display MsgBox
    By TcM in forum JavaScript Tutorials
    Replies: 16
    Last Post: 08-13-2009, 05:29 AM
  4. MsgBox problem
    By j0rd4nn in forum Visual Basic Programming
    Replies: 8
    Last Post: 01-20-2009, 12:05 PM
  5. How do i enable changes in document during msgbox?
    By yonyts in forum Visual Basic Programming
    Replies: 5
    Last Post: 04-07-2008, 04:42 AM

Tags for this Thread

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