Académique Documents
Professionnel Documents
Culture Documents
12 de
nov.
Practica Nº22
080260173-2
5101- I
12 de Noviembre de 2010
1
Practica Nº22
12 de
nov.
Lista de Cotejo
INSTRUCCIONES DE APLICACIÓN.
Verifique que se encuentren los componentes señalados abajo y marque con una √ el registro
de cumplimiento correspondiente.
DESARROLLO
REGISTRO DE
REGISTRO DE
2
Practica Nº22
12 de
nov.
Practica Nº22
Manejo de estructuras de repetición en ordenamiento
FORMULARIO
Botón consultar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
cn.Open()
Dim mostrardatos As String = "Select * from Fechas"
Dim dataAdapter As New OleDb.OleDbDataAdapter(mostrardatos, cn)
dataAdapter.Fill(dt)
For fila = 0 To dt.Rows.Count - 1
Actualiza()
Next
dataAdapter.Dispose()
cn.Close()
End Sub
Función actualiza
Public Sub Actualiza()
ListBox1.Items.Add(Int(dt.Rows(fila)("d")))
ListBox2.Items.Add(Int(dt.Rows(fila)("m")))
ListBox3.Items.Add(Int(dt.Rows(fila)("a")))
End Sub
3
Practica Nº22
12 de
nov.
Label4.Text = Label4.Text + " de Junio de "
Case 7
Label4.Text = Label4.Text + " de Julio de "
Case 8
Label4.Text = Label4.Text + " de Agosto de "
Case 9
Label4.Text = Label4.Text + " de Septiembre de "
Case 10
Label4.Text = Label4.Text + " de Octubre de "
Case 11
Label4.Text = Label4.Text + " de Noviembre de "
Case 12
Label4.Text = Label4.Text + " de Diciembre de "
End Select
Label4.Text = Label4.Text + Str(ListBox3.SelectedItem)
End Sub
Botones Ordenar
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click
Dim x As Integer
Dim a(ListBox1.Items.Count) As Integer
Dim y As Integer
Dim temp As Integer
For x = 0 To ListBox1.Items.Count - 1
a(x) = ListBox1.Items(x)
Next x
y = 0
For x = 0 To ListBox1.Items.Count - 1
For y = 0 To ListBox1.Items.Count - 1
If (a(y) > a(y + 1)) Then
temp = a(y + 1)
a(y + 1) = a(y)
a(y) = temp
End If
Next
Next
ListBox1.Items.Clear()
For x = 1 To 6
ListBox1.Items.Add(a(x))
Next
End Sub
4
Practica Nº22
12 de
nov.
Next
ListBox2.Items.Clear()
For x = 1 To 6
ListBox2.Items.Add(a(x))
Next
End Sub
Formulario consultar
Formulario Ordenado