1. Formulariomdi
Private Sub SALIRToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles SALIRToolStripMenuItem.Click
' End
Application.Exit()
End Sub
Private Sub REGISTRODETRABAJADORESToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
REGISTRODETRABAJADORESToolStripMenuItem.Click
REPORTEPERSONAL.Show()
End Sub
Private Sub REGISTRODEPLAZASToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
REGISTRODEPLAZASToolStripMenuItem.Click
Form2.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Form2.txtrecibido.Text = txtenviar.Text
Form2.ShowDialog()
End Sub
2. Control de usuario
Public Class LoginForm1
Dim user, pw As String
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles OK.Click
If user = UsernameTextBox.Text Then
If pw = PasswordTextBox.Text Then
Form1.Show()
PasswordTextBox.Text = ""
Else
MsgBox("clave incorrecto")
PasswordTextBox.Text = ""
PasswordTextBox.Focus()
End If
Else
MsgBox("usuario incorrecto")
UsernameTextBox.Text = ""
PasswordTextBox.Text = ""
UsernameTextBox.Focus()
End If
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Para declarerlosusuarios
Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
user = "mario"
pw = "1234"
End Sub
3. Arreglos
Public Class Form1
Dim ventas(12) As Decimal
Dim i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
i = Me.Txtmes.Text
If i >= 1 And i <= 12 Then
ventas(i) = Me.Txtimporte.Text
Else
MsgBox("ingrese valor del 1 al 12")
End If
Txtmes.Text = ""
Txtimporte.Text = ""
Txtmes.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
'ingresar datos
i = 1
Me.DataGridView1.Rows.Clear()
Do While i <= 12
DataGridView1.Rows.Add(i, ventas(i))
i = i + 1
Loop
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
i = 1
Do While (i <= 12)
ventas(i) = 0
i = i + 1
Loop
Me.DataGridView1.Rows.Clear()