That's a bit to less on informations.
Which project type are you using?Is Is a reference/Import for Microsoft.VisualBasic set?
And why do you use old VB style MsgBox and not the common MessageBox Class?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
For the first time MsgBox() doesn't work. Error BC30451 (In italian: MsgBox non dichiarato. Potrebbe essere inaccessibile a causa del livello di protezione - something like MsgBox not declared. Could be inaccessible because of level protection). Kindly, help me!
That's a bit to less on informations.
Which project type are you using?Is Is a reference/Import for Microsoft.VisualBasic set?
And why do you use old VB style MsgBox and not the common MessageBox Class?
You can always make your own e.g.
Add this module to your project (add more wrappers as you see fit)
Public Module Dialogs
Public Function Question(Text As String) As Boolean
Return (MessageBox.Show(Text, My.Application.Info.Title, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = MsgBoxResult.Yes)
End Function
Public Function Question(Text As String, Title As String) As Boolean
Return (MessageBox.Show(Text, Title, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = MsgBoxResult.Yes)
End Function
Public Sub MsgBox(Text As String)
MessageBox.Show(Text, My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
End Sub
Public Sub MsgBox(Text As String, Title As String)
MessageBox.Show(Text, Title, MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
End Sub
End Module
Use it
Public Class Form1
Private Sub MsgBoxButton_Click(sender As Object, e As EventArgs) Handles MsgBoxButton.Click
MsgBox("Simple")
If Question("Continue?") Then
MsgBox("Yes")
Else
MsgBox("No")
End If
End Sub
End Class