May 16, 2008

Simple Message Box

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > VB Programming

free web hosting

Simple Message Box

xplorer-ex
hi all, heres a simple tutorial on how to make a message box in VB

start a new form in visual basic,

draw a command button which should contain the text "Command1" when drawn,

double click on the button, and write the code

CODE
msgbox "Hello World", vbcritical, "Xplorer_3X Says..."


so your code should look like this;

CODE
Private Sub Command1_Click()
msgbox "Hello World", vbcritical, "Xplorer_3X Says..."
end sub


Now compile the project and click on the button, and Wa-laa, there she be.

Reply

Ridwan sameer
HMM although myVB currently cannot be installed ( due to HDD and server problems) This seems god

But not that effective good for newbies Whi just bought VB but for me it is too simple but wil try ti out

Reply

Reygekan
I'm not sure about the use of "vbcritical" as I've never seen that before while using Visual Basic =/ Simply

CODE
Msgbox('Enter Text')


would do the job assuming you're using the .NET version of VB.

Reply

Galahad
QUOTE(Reygekan @ Jun 21 2007, 07:55 AM) *
I'm not sure about the use of "vbcritical" as I've never seen that before while using Visual Basic =/ Simply

CODE
Msgbox('Enter Text')


would do the job assuming you're using the .NET version of VB.


CODE
MsgBox(prompt[, buttons] [, title] [, helpfile, context])


Buttons argument; can be combined using butwise operator OR:

This is the list of available constants that determine which buttons will appear on the message box:
  • 0 - vbOKOnly - OK button only.
  • 1 - vbOKCancel - OK and Cancel buttons.
  • 2 - vbAbortRetryIgnore - Abort, Retry, and Ignore buttons.
  • 3 - vbYesNoCancel - Yes, No, and Cancel buttons.
  • 4 - vbYesNo - Yes and No buttons.
  • 5 - vbRetryCancel - Retry and Cancel buttons.
This is the list of available constants that determine which images will appear on the message box:
  • 16 - vbCritical - Critical Message icon.
  • 32 - vbQuestion - Warning Query icon.
  • 48 - vbExclamation -Warning Message icon.
  • 64 - vbInformation - Information Message icon.
There are some more constants, determinig behaviour of the buttons, or the message box itself, but they can be found in the Visual Basic help...

MsgBox can also be used as a function, where it returns different values, for different buttons that are pressed:
  • 1 - vbOK - OK
  • 2 - vbCancel - Cancel
  • 3 - vbAbort - Abort
  • 4 - vbRetry - Retry
  • 5 - vbIgnore - Ignore
  • 6 - vbYes - Yes
  • 7 - vbNo - No

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : message

  1. Tray Info Message - Kind of popup thingie (6)



Looking for simple, message, box

Searching Video's for simple, message, box
advertisement



Simple Message Box



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE