domingo, 5 de junio de 2011

Ejercicio Pasar de un grupo a otro

 EJERCICIO PASAR DE UN GRUPO A OTRO



 

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Add(TextBox1.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox2.Items.Add(TextBox1.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
ListBox1.Items.Add(ListBox2.SelectedItem)
ListBox2.Items.RemoveAt(ListBox2.SelectedIndex)
End Sub

End Class

Ejercicio Listbox




Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Add(TextBox1.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
End Sub
End
Class

lunes, 2 de mayo de 2011

Ejercicio Residencia

 EJERCICIO RESIDENCIAS


Public Class Total

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Tipo As String
        Dim VTSs As Single = 0
        Dim Total As Single

        If RadioButton1.Checked Then
            Tipo = "Sencilla"
        Else
            If RadioButton2.Checked Then
                Tipo = "Doble"
            Else
                If RadioButton3.Checked Then
                    Tipo = " Triple"
                End If
            End If
        End If
        If CheckBox1.Checked Then
            VTSs += 10000
        End If
        If CheckBox2.Checked Then
            VTSs += 10000
        End If
        If CheckBox3.Checked Then
            VTSs += 10000
        End If
        Select Case Tipo
            Case "Sencilla"
                Total = 50000 + VTSs


            Case "Doble"
                Total = 80000 + VTSs

            Case "Triple"
                Total = 100000 + VTSs

        End Select
        TextBox1.Text = CStr(Total)
    End Sub
End Class

Ejercicio Seleccion


EJERCICIO SELECCION FIGURA




Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim figura As String
Dim grafico As Graphics
Dim lapiz As Pen

If RadioButton1.Checked Then
figura = "circulo"
Else
If RadioButton2.Checked Then
figura = "linea"
Else
If RadioButton3.Checked Then
figura = " cuadrado"
End If

End If

End If

Select Case figura

Case "circulo"
grafico = CreateGraphics()
lapiz = New Pen(Color.PaleVioletRed, 4)
grafico.DrawEllipse(lapiz, 10, 10, 110, 300)

Case "linea"


grafico = CreateGraphics()
lapiz = New Pen(Color.Blue, 4)
grafico.DrawLine(lapiz, 10, 10, 100, 100)

Case " cuadrado"

grafico = CreateGraphics()
lapiz = New Pen(Color.Red, 4)
grafico.DrawRectangle(lapiz, 50, 50, 150, 150)




End Select


End Sub

Ejercicio Cuadrado

EJERCICIO CUADRADO



Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim grafico As Graphics
Dim lapiz As Pen
grafico = CreateGraphics()
lapiz =
New Pen(Color.Blue, 2)
grafico.DrawRectangle(lapiz, 128, 10, 100, 100)

End Sub
End
Class

Ejercicio Circulo

 EJERCICIO CIRCULO

 

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim grafico As Graphics
Dim lapiz As Pen
grafico = CreateGraphics()
lapiz =
New Pen(Color.Blue, 2)
grafico.DrawEllipse(lapiz, 128, 10, 100, 100)

End Sub
End
Class

Ejercicio Linea

 EJERCICIO LINEA


 
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim grafico As Graphics 
Dim lapiz As Pen grafico = CreateGraphics()
lapiz =
New Pen(Color.Blue, 2)
grafico.DrawLine(lapiz, 10, 10, 100, 100)

End Sub
End
Class