Questions tagged [msgbox]

The MsgBox function is used in Visual Basic to display a dialog box to the user, wait for a button to be clicked and return the result to the caller. Use this question for using MsgBox specifically; for the .NET MessageBox class, use the "messagebox" tag instead.

Summary

The MsgBox function is exclusive to the Visual Basic programming language. It is commonly used in , or Visual Basic for Applications (), but can also be used in Visual Basic .NET for backwards compatibility. (However, in , it is recommended to use the MessageBox class from the .NET Framework instead.)

Function signature

As listed on MSDN:

Public Function MsgBox( _
   ByVal Prompt As Object, _
   Optional ByVal Buttons As MsgBoxStyle = MsgBoxStyle.OKOnly, _
   Optional ByVal Title As Object = Nothing _
) As MsgBoxResult
  • Prompt is used to set the text you want to display in the dialog box.
  • Buttons is used to set which buttons are displayed in the dialog box. If omitted, only the OK button is shown by default.
  • Title is used to set the title text for the dialog box. If omitted, the application name is displayed by default.

The return value is a numeric value indicating what action the user took in response to the dialog (i.e., which presented button was clicked).

Related tags

Useful questions

Links

403 questions
0
votes
1 answer

Macro Bulder MS Access Insert textbox value into msgbox

I have a macro built through the macro builder that has a msgbox that says "success, you've been assigned task number:" I would like the task number taken from a "tboTaskNumber" to follow this message. I can easily do this in VBA, however I am…
Dm3k1
  • 187
  • 3
  • 8
  • 21
0
votes
1 answer

Issue with MsgBox added under for loop

I have the following code added under a function and also under for loop. If Not setFcType(agt, ma, sma) Then fcComm1 = "Error" MsgBox "Entered Agt/Ma/Sma value is incorrrect", vbOKOnly Exit Function End If When i enter any values in…
Fenixs
  • 377
  • 1
  • 4
  • 20
0
votes
1 answer

jquery msgBox execution in code behind(c#)

I want to show a message box when user enters wrong ıd or password. I write following function to the .aspx file: