viernes, 14 de septiembre de 2012

Diseño de Formulario



Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button1.Click
        Dim login As String = Me.TextBox1.Text.ToUpper
        Dim clave As String = TextBox2.text
        If login = "VB" And clave.ToUpper = "NET" Then
               MessageBox.Show("Usuario Válido", "Mensaje",
MessageBoxButton.OK, MessageBoxIcon.Information)
        Else
               MessageBox.Show("Usuario no Válido", "Mensaje",
MessageBoxButton.OK, MessageBoxIcon.Error)
        End If
    End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button2.Click

        If MessageBox.Show("Desea Salir?", "Confirmar",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.
Forms.DialogResult.Yes Then
        REM Cierra el form
        Me.Close() 'cierra
        End If
    End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button3.Click

        MessageBox.Show("Ingrese su login password", "Mensaje",
MessageBoxButtons.OK, MessageBoxIcon.Information)
    End Sub

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal
e As System.Windows.Forms.FormClosingEventArgs) Handles
Me.FormClosing
       
        If MessageBox.Show("Desea Salir?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.
Forms.DialogResult.No Then
        e.Cancel = True
        End If
    End Sub

No hay comentarios:

Publicar un comentario