
31/05/2007, 10:32
|
(Desactivado) | | Fecha de Ingreso: julio-2006
Mensajes: 273
Antigüedad: 18 años, 7 meses Puntos: 5 | |
Re: arreglos en vb.net - invertir aca esta el codigo. talvez te sirva
Public Class Form1
Private i As Integer
Private Sub btnAgregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAgregar.Click
If txtNuevo.Text <> Nothing And IsNumeric(txtNuevo.Text) Then
i += 1
Lista.Items.Add(txtNuevo.Text)
txtNuevo.Text = Nothing
Else
MsgBox("Error")
txtNuevo.Text = Nothing
End If
End Sub
Private Sub Burbuja()
Dim x, y, aux As Integer
For x = 0 To i
For y = 0 To i - 1
If Lista.Items(y) > Lista.Items(y + 1) Then
aux = Lista.Items(y)
Lista.Items(y) = Lista.Items(y + 1)
Lista.Items(y + 1) = aux
End If
Next
Next
End Sub
Private Sub burbujadoble()
Dim x, y, aux As Integer
For x = 0 To i
For y = 0 To i - 1
If Lista.Items(y) < Lista.Items(y + 1) Then
aux = Lista.Items(y)
Lista.Items(y) = Lista.Items(y + 1)
Lista.Items(y + 1) = aux
End If
Next
Next
End Sub
Private Sub btnOrdenDes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOrdenDes.Click
i = Lista.Items.Count - 1
Burbuja()
End Sub
Private Sub btnSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSalir.Click
Me.Close()
End Sub
Private Sub btnOrdenAs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOrdenAs.Click
i = Lista.Items.Count - 1
burbujadoble()
End Sub
End Class
si no lo entiendes muy bien enviame un mensaje para pasarte por correo la aplicacion. |