domingo, 16 de septiembre de 2012

Diseño de Formulario



Diseño de Formulario




Public Class Form1


    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub

    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 Valido", "Mensaje" MessageBoxButtons.OK, MessageBoxIcon.Information)
        Else
            MessageBox.Show("Usuario no valido", "Mensaje", MessageBoxButtons.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 y 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
End Class

No hay comentarios:

Publicar un comentario