0% found this document useful (0 votes)
22 views

Ventana de Carga de Programa

The document contains code for a login window application in Visual Basic. It includes code to: 1) Gradually increase the size of the initial loading window over 30 seconds before opening the login window. 2) Open a login window that checks user credentials against a database table and either opens the main application window or displays an error if the password is incorrect. 3) Populate a dropdown with user names from the database table and include buttons to login or clear the login form.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Ventana de Carga de Programa

The document contains code for a login window application in Visual Basic. It includes code to: 1) Gradually increase the size of the initial loading window over 30 seconds before opening the login window. 2) Open a login window that checks user credentials against a database table and either opens the main application window or displays an error if the password is incorrect. 3) Populate a dropdown with user names from the database table and include buttons to login or clear the login form.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

VENTANA DE CARGA DE PROGRAMA

CODIGO FUENTE Public Class Dim x As Dim c As Dim i As frmPresentacion Integer Integer Integer

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If Me.Width <= 700 Then Me.Width = Me.Width + 11 Me.Height = Me.Height + 8 c = c + 1 End If If c = 30 Then Timer2.Interval = 2000 Timer2.Enabled = True End If ProgressBar1.Value = i i = i + 5 If i = 400 Then Timer1.Enabled = False End If End Sub Public Sub cerrar() Timer1.Enabled = False Timer2.Enabled = False Dim frmC As New frmContrasena MyBase.Finalize() frmC.Show() End Sub Private Sub frmPresentacion_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Enabled = True Timer1.Interval = 1 i = 5 ProgressBar1.Maximum = 400 ProgressBar1.Minimum = 1 End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick For Me.i = 1 To 10 If i = 10 Then cerrar() End If Next End Sub End Class VENTANA DE INICIO DE SESION

CODIGO FUENTE Imports System Imports System.Data Public Class frmContrasena Dim cnn As OleDb.OleDbConnection Dim ban1, ban2 As Integer Dim ban3 As Integer Private Sub btnIngresar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnIngresar.Click Dim MiDataSet As New DataSet() cnn.Open() Dim comando As New OleDb.OleDbDataAdapter("SELECT* FROM USUARIO", cnn) comando.Fill(MiDataSet, "USUARIO") Dim bn As Integer bn = 0 Dim rowi ban1 = 1 For Each rowi In MiDataSet.Tables(0).Rows If cboUsuario.Text = rowi(1).ToString() Then ban1 = 0 If txtContrasena.Text = rowi(4).ToString() Then ban2 = 0 GoTo salir Else ban1 = 1 ban2 = 1 End If End If Next salir: If ban1 = 0 And ban2 = 0 And ban3 = 0 Then MyBase.Finalize() frmPrincipal.Show() Else MessageBox.Show("Es incorrecto el pasword - !!VUELVA A ESCRIBIR!!") End If cnn.Close() End Sub Private Sub btnLimpiar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLimpiar.Click txtContrasena.Clear() End Sub Private Sub frmContrasena_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

ban1 = 0 ban2 = 0 cnn = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DBProy253.mdb") Dim rsc As New OleDb.OleDbCommand Dim adap As New OleDb.OleDbDataAdapter("SELECT* FROM USUARIO", cnn) Dim da As New DataSet cargar_usuario() End Sub Sub cargar_usuario() Dim MiDataSet As New DataSet() cnn.Open() Dim comando As New OleDb.OleDbDataAdapter("SELECT* FROM USUARIO", cnn) comando.Fill(MiDataSet, "USUARIO") Dim row cboUsuario.Items.Clear() For Each row In MiDataSet.Tables(0).Rows cboUsuario.Items.Add(row(1).ToString()) Next cnn.Close() End Sub Private Sub Button3btnCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3btnCancelar.Click End End Sub End Class

You might also like