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
-1
votes
1 answer

Yes/No permission required

I have created a VBA and have tried to add a MsgBox to confirm I do want to continue. The MsgBox appears but does not respond if I click OK or X.I was hoping to be given a Yes/No choice. Sub Clear_sheet() ActiveSheet.Unprotect Dim AnswerYes As…
MrEMann
  • 1
  • 1
-1
votes
1 answer

Stop MsgBox display loop based on cell value

I want to tell the user the value entered is unavailable. The question below bears no relevance to the problem (I can't choose the available options from a drop down - it's more than that). Question in Cell B25: "Do you want this available in…
-1
votes
2 answers

Do a cmd command in a msgbox

So, my goal is that I want to get a msgbox that tells me what power plan I'm on without using the command prompt. I've tried making a batch file but that only does the command. start cmd /k powercfg/getactivescheme When I try doing it from the…
-1
votes
1 answer

Is this possible to call users define sub procedure using msgbox?

For example code: show_box() Function show_box() result = MsgBox ("Please follow steps in document"vbCrLf & vbCrLf _ & "Click OK to call sum procedure" & vbCrLf & vbCrLf _ & "Click No to call substraction…
S_sauden
  • 302
  • 2
  • 10
-1
votes
1 answer

Displaying function value + text in MsgBox

I want to display a message box that will show both things: 1)A result from a hlookup calculation 2)General Text The hloohup itself is working (I tested the Msg Box with it only) but I don't know how to concatenate "Text" + hllokup result. The…
-1
votes
2 answers

msgBox / Alert with Powershell on MacOs

I know how to make a VBS msgBox on windows message = ("HELLO",0,"Title") But I want to do this on Mac with Powershell Thank you for you answers :D
-1
votes
2 answers

VBA vbYesNo Inquiry

I am trying to create a message box that will give the user the option to continue or stop if their search comes up with more than 1000 results. I have the message box made, but I don't know how to code the vbYes and the vbNo to either continue on…
Caleb Sutton
  • 75
  • 11
-1
votes
1 answer

SQL records in a MsgBox

I have a VBS program that works great. My code below: Dim qry, db, cs, cn, cmd 'Query to add all the following which date more than 20 days in the table ToUnfollow qry = "INSERT INTO ToUnfollow " & _ "SELECT Name FROM Follow t1 " & _ …
leyh
  • 241
  • 2
  • 4
  • 13
-1
votes
2 answers

Finding a prorcess by name,indicating to user that the process run,then killing the process

I want to make a simple update application in vb.net,but,it cant update the file,cause the file is running.So,i want to find all processes called "seemta helper(this is how Task m. show it's name)"and,if,a process is running with that…
-1
votes
1 answer

Show in MSgBox all nonempty values from row

I am working on an Excel sheet of row size A:ZZ and there should only be 7 cells with values. I am trying to make a kind of "filter" that will check the number of non empty cells and in case when there will be more than 7 nonempty cells will print a…
vonski
  • 7
  • 1
  • 6
-1
votes
1 answer

Winform VB.net how to popup msgbox yes/no when detect string in richtextbox

I am developing software that uses serial communications for data transmission . My problem is related to richtextbox which is I want to make a popup InputBox when the word "change configuration ?" appears in the richtextbox . Please help me. this…
-1
votes
1 answer

Quadratic Equation Visual Basic 2010+

I have to write a program which calculate quadratic equation and find its roots. The roots must be displayed via MsgBox-es, and the variables A, B and C must be entered via InputBox-es. For now I have written this, but it somehow doesn't work and I…
-1
votes
3 answers

If and else statements in easyGUI?

So i have a basic question: how to use if and else statements correctly with easyGUI? This is what I have: import easygui msg = "Oh i see m9, choos your difficulty" title = "Mountain Dew Franchise" choices = ["Pro 360 noscoper(+1001)", "Dank…
-1
votes
2 answers

Passing values from jQuery to PHP in same page instantly

I have written a PHP program to confirm deletion of data through jQuery confirm message (Refer: http://rathur.fr/jQuery/MsgBox/) and record the result back to the same page itself instantly. If the page refreshes, it'll return back its state to…
ak-SE
  • 980
  • 1
  • 7
  • 27
-1
votes
2 answers

MessageBox Top Most True

is there way to make the default messagebox ( MessageBox.Show() ) TopMost true which also stays on top even if the messagebox lost the focus? I don't want to create a custom one. Is there a way doing it by using SetWindowHook or something similar? I…
nexno
  • 429
  • 8
  • 26
1 2 3
26
27