ESTUDIO DE LOS MENSAJES EN VISUAL BASIC
Se crea el Formulario y se introduce el siguiente código:
Dim tipo As Integer
Dim texto1 As String
Dim titulo1 As String
Dim texto2 As String
Dim titulo2 As String
Dim textodefecto
As String
Dim retorno
As Integer
Dim textoretorno
As String
Private Sub Command1_Click()
On Error Resume Next
tipo = CInt(Text1.Text)
titulo = Text2.Text
texto = Text3.Text
retorno = MsgBox(texto,
tipo, titulo)
Label7.Caption = "El
retorno del Mensaje es = " & retorno
End Sub
Private Sub Command2_Click()
titulo2 = Text4.Text
texto2 = Text5.Text
textodefecto = Text6.Text
textoretorno = InputBox(texto2, titulo2, textodefecto)
Label7.Caption = "El
retorno es = " & textoretorno
End Sub
Private Sub Form_Load()
tipo = 0
texto1 = "Texto del Mensaje"
titulo1 = "Titulo del Mensaje"
retorno = 1
texto2 = "Texto del Mensaje"
titulo2 = "Titulo del Mensaje"
textodefecto =
"Texto por defecto"
Text1.Text = tipo
Text2.Text = titulo1
Text3.Text = texto1
Text4.Text = titulo2
Text5.Text = texto2
Text6.Text = textodefecto
End Sub