Message box - dialog box in visual basic, Visual Basic Programming

Message Box:

The Message Box can be specified a title as shown in figure to specify the title for the message box follow by the command given below:

 Private Sub Command1_Click()

Dim i As Integer

i = 80

MsgBox "i is " & i, vbOKCancel, "demo"

End Sub

1118_message box.png

Figure: Message box

Whenever the command button is clicked a message box is exhibited with the contents as " i is 80" and OK and Cancel buttons are exhibited. The message box is exhibited with a title as demo that is the third parameter of the MsgBox command.

Whenever the mouse is clicked on the form, and the event Form_MouseDown gets executed. The event handler is specified below. The contents of the MsgBox would be the demo of msgbox and Yes, No buttons would be exhibited on the MsgBox as shown in figure. The third parameter, namely the sample would be the title of the MsgBox.

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y

As Single)

MsgBox "demo of msgbox", vbYesNo, "sample"

End Sub

 

305_message box1.png

Figure: Message box

Posted Date: 10/9/2012 9:17:45 AM | Location : United States







Related Discussions:- Message box - dialog box in visual basic, Assignment Help, Ask Question on Message box - dialog box in visual basic, Get Answer, Expert's Help, Message box - dialog box in visual basic Discussions

Write discussion on Message box - dialog box in visual basic
Your posts are moderated
Related Questions
The Document: The document contains the user's data. For illustration, after working on a text processor, the user may wish for to save the file. Such an action builds a docum

Associating Toolbars for the menu: 1. Insert the tool bar control to your form. 2. Now follow the steps to append the tool bar control to your form. 3. Then, Right Click

Check Box: The check box control takes the value as on or off or grayed. The grayed one is neither on nor off. The user can transform the setting of the grayed check box.

Do Until Loop Statement: The statements within the do...until loop block executes till the condition given in until become true. The working of do...until loop is elaborated w

A variable is convenient placeholder which refers to a computer memory location where you can store program information which may change when your script is running. For instance,

Dialog Based Application: The application which app wizard generates is based on the dialog template resource.

I have an external application I open from visual studio (excel). I want to reposition where that opens (top, left).. How do I do that?

Executesql: The ExecuteSQL is used for executing the query on the database. The CRecordset uses the RFX mechanism to replace data between field data members of the record set

Adding Records: 1. As in the earlier case Set the DatabaseName property as "C:\ex.mdb", now Set the Record Source for the data control as Customer and Set the Record Type to 0

Tab Order: The tab order stands for the order in which the controls receive focus when the user clicks the tab key. The CTRL + D can be used to set the tab order of controls.