Smart Device Project 1
Smart Device Project 1
ToString() & " cuidades " End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.Items.Add("arequipa") ComboBox1.Items.Add("tacna") End Sub Private Sub btnagregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnagregar.Click 'primer codigo 'Dim ciudad As String 'ciudad = txtnombre.Text 'ComboBox1.Items.Add(ciudad) 'If (ciudad = "") Then ' MsgBox("agregue un nombre para continuar jejejejjeeje...") 'Else ' ComboBox1.Items.Add(ciudad) 'End If 'segundo codigo 'If (txtnombre.Text = "") Then ' MsgBox("falta ingresar un nombre") 'Else ' Dim ciudad As String
' ciudad = txtnombre.Text ' ComboBox1.Items.Add(ciudad) 'End If 'tercer codigo Dim ciudad As String = txtnombre.Text.Trim If ciudad.Length() > 2 Then ComboBox1.Items.Add(ciudad) Else MsgBox("el nombre de la ciudad debe tener 3 o mas letras") End If txtnombre.Text = "" contar() End Sub Private Sub btnquitar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnquitar.Click 'Dim x As Integer 'x = ComboBox1.SelectedIndex 'ComboBox1.Items.RemoveAt(x) 'contar() Dim x As Integer x = ComboBox1.SelectedIndex If x >= 0 Then ComboBox1.Items.RemoveAt(x) contar() Else MsgBox("seleccione una ciudad", , "error") End If End Sub Private Sub btnlimpiartodo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlimpiartodo.Click ComboBox1.Items.Clear() End Sub End Class
Public Class Form2 Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged Dim dia As String txtao.Text = DateTimePicker1.Value.Year txtmes.Text = DateTimePicker1.Value.Month txtdia.Text = DateTimePicker1.Value.Day txtsemana.Text = DateTimePicker1.Value.DayOfWeek dia = DateTimePicker1.Value.TimeOfDay.ToString() If txtsemana.Text = "0" Then txtsemana.Text = "domingo" End If If txtsemana.Text = "1" Then txtsemana.Text = "lunes" End If If txtsemana.Text = "2" Then txtsemana.Text = "martes" End If If txtsemana.Text = "3" Then txtsemana.Text = "miercoles" End If If txtsemana.Text = "4" Then txtsemana.Text = "jueves" End If If txtsemana.Text = "5" Then txtsemana.Text = "viernes" End If If txtsemana.Text = "6" Then txtsemana.Text = "sabado" End If Me.Text = DateTimePicker1.Value.TimeOfDay.ToString() End Sub
End Class