Documentos de Académico
Documentos de Profesional
Documentos de Cultura
SegundaEntrega PDF
SegundaEntrega PDF
Net 2003
Aplicacin N 22
Control Name
PictureBox1 imgimagen
Timer1 tmrpresentacion
Antes que todo, cambiaremos algunas cosas en propiedades del control Timer.
Me.Close()
Me.Close()
Como se habrn dado cuenta, en este control han cambiado algunas cosas,
como es la ubicacin del control, ya que para ubicar el control en el
formulario. Por ejemplo, para ubicar el control PictureBox en el formulario.
Picture1.ScaleWidth = 656
Picture1.ScaleHeight = 392
Picture1.Picture = "C:\Imagenes\WINNIE"
imgimagen.Image = Image.FromFile(C:\Imagenes\WINNIE)
Aplicacin N 23
Control Name
Label2 lblfecha
Label4 lblhora
Label9 lblsubtotal
Label11 lbligv
Label13 lbltotal
TextBox1 txtnomprod
TextBox2 txtprecuni
TextBox3 txtcant
Button1 btnnuevo
Button2 btnresultados
Button3 btnsalir
Paso N 3: Codificar.
txtnomprod.Text = ""
txtprecuni.Text = ""
txtcant.Text = ""
lblsubtotal.Text = ""
lbligv.Text = ""
lbltotal.Text = ""
txtnomprod.Focus()
Aplicacin N 24
Control Name
Label1 lblporcentaje
Label2 lblavance
ProgressBar1 lblresultado
TrackBar1 tkbavance
NumericUpDonw1 nudN1
NumericUpDonw1 nudN2
Button1 btncomenzar
Button2 btnsumar
NotifyIcon1 NotifyIcon
Paso N 3: Codificar.
lblavanze.Text = tkbavance.Value
Dim I As Integer
Dim J, K As Single
For I = 0 To 100
lblprogreso.Text = Str(I) & " %"
pgbprogreso.Value = I
For J = 0 To 10000
For K = 0 To 500
Next
Next
Next
Aplicacin N 25
Control Name
Button1 btnmostrar
Button2 btnsalir
Paso N 3: Codificar.
Static P As Integer
P=P+1
If P = ImageList1.Images.Count Then
P=0
End If
PictureBox1.Image = ImageList1.Images(P)
Me.Close()
Aplicacin N 26
Control Name
PictureBox1 PictureBox1
StatusBar stbinformacion
Timer tmrhora
Paso N 3: Codificar.
Para agregar un Panel tendremos que darle clic en Agregar y luego seleccionar el
icono que queramos que se presente ya sea con el texto que le pongamos en la
Propiedad Text, y la propiedad Width sirve para cambiar el tamao del panel.
Aplicacin N 27
Control Name
Label2 lbldia
Label4 lblmes
Label6 lblanio
Label8 lblnombdia
Label10 lblnombmes
Label12 lbldia1
Label14 lblmes2
Label16 lblanio1
Label18 lblnombdia1
Label20 lblnombmes1
Button1 btnverDC
Button2 btnverDTP
Paso N 3: Codificar.
Funcin NombreMes
Funcin NombreMes
NumMes = Microsoft.VisualBasic.Month(MonthCalendar1.SelectionEnd)
NumDia = Microsoft.VisualBasic.Weekday(MonthCalendar1.SelectionEnd)
lbldia.Text = Microsoft.VisualBasic.Day(MonthCalendar1.SelectionEnd)
lblmes.Text = NumMes.ToString
lblanio.Text = Microsoft.VisualBasic.Year(MonthCalendar1.SelectionEnd)
lblnombmes.Text = NombreMes(NumMes)
lblnombdia.Text = NombreDia(NumDia)
NumMes = Microsoft.VisualBasic.Month(DateTimePicker1.Value)
NumDia = Microsoft.VisualBasic.Weekday(DateTimePicker1.Value)
lbldia1.Text = Microsoft.VisualBasic.Day(DateTimePicker1.Value)
lblmes1.Text = NumMes.ToString
lblanio1.Text = Microsoft.VisualBasic.Year(DateTimePicker1.Value)
lblnombmes1.Text = NombreMes(NumMes)
lblnombdia1.Text = NombreDia(NumDia)
Aplicacin N 28
Control Name
TextBox1 txtalumno
ComboBox1 cboespecialidad
ComboBox2 cboturno
Button1 btnotro
Button2 btnfinalizar
Paso N 3: Codificar.
txtnombre.Text = ""
cboespecialidad.SelectedIndex = 0
cboturno.SelectedIndex = 0
txtnombre.Focus()
Me.Close()
Control ComboBox: Que hay de nuevo en este control?, bueno la verdad que
nada, hasta su propio codigo no ha cambiado mucho si se han dado cuenta, solo
que ahora para poder poder tems al control tendremos que hacer clic en tems en
la ventana de propiedades, y luego escribir el item que se mostrara (una linea por
cada Item).
Editor de tems.
Aplicacin N 29
Permanente 15.00
Contratado 10.00
Eventual 5.00
Control Name
TextBox1 txtnombre
TextBox2 txthorastrab
Label4 lblpagoxhora
Label7 lbltotal
ComboBox2 cbotipo
Button1 btnnuevo
Button2 btnsalir
Paso N 3: Codificar.
Me.Close()
cbotipo.Items.Add("Permanente")
cbotipo.Items.Add("Contratado")
cbotipo.Items.Add("Eventual")
imgimagen.Visible = False
btnnuevo.Enabled = False
Index = cbotipo.SelectedIndex
Select Case Index
Case 0
lblpagoxhora.Text = "15.00"
Case 1
lblpagoxhora.Text = "10.00"
Case 2
lblpagoxhora.Text = "5.00"
End Select
If Trim(txthorastrab.Text) = "" Then
txthorastrab.Focus()
Else
lbltotal.Text = Format(Val(lblpagoxhora.Text) * Val(txthorastrab.Text),
"###,##0.00")
End If
txtnombre.Text = ""
cbotipo.SelectedIndex = 0
lblpagoxhora.Text = ""
txthorastrab.Text = ""
lbltotal.Text = ""
imgimagen.Visible = False
txtnombre.Focus()
Solo hay una cosa que recalcar o mejor dicho aclara, ahora para insertar un
nuevo elemento o eliminar, se har mediante el miembro de Item, por
ejemplo:
Combo1.AddItem Texto
ComboBox1.Items.Add(Texto)
Aplicacin N 30
Control Name
NumericUpDonw1 nudVA
NumericUpDonw2 nudVB
ListBox1 ListBox1
CheckedListBox1 CheckedListBox1
Button1 btncalcular
Paso N 3: Codificar.
Control CheckedListBox: Este control nos permite tener varias opciones a elegir,
en una sola caja parecida al ListBox, para poder editar este control y poner que
opciones va a tener, tendremos que darle clic en la opcion tems de la ventana de
propiedades del control.
Ventana de Propiedades
Aplicacin N 31
Control Name
TextBox1 txtprofesor
ComboBox1 cbotipodecurso
ComboBox2 cbonombdecurso
Button1 btnnuevo
Button2 btnsalir
Paso N 3: Codificar.
Me.Close()
Nuevo()
Index = cbotipodecurso.SelectedIndex
Select Case Index
Case 0
cbonombdecurso.Items.Clear()
cbonombdecurso.Items.Add("Windows Vista")
cbonombdecurso.Items.Add("Word")
cbonombdecurso.Items.Add("Excel")
cbonombdecurso.Items.Add("Point")
cbonombdecurso.SelectedIndex = 0
Case 1
cbonombdecurso.Items.Clear()
cbonombdecurso.Items.Add("Foxpro")
cbonombdecurso.Items.Add("Visual Basic")
cbonombdecurso.Items.Add("Visual Foxpro")
cbonombdecurso.Items.Add("Power Builder")
cbonombdecurso.SelectedIndex = 0
Case 2
cbonombdecurso.Items.Clear()
cbonombdecurso.Items.Add("Internet")
cbonombdecurso.Items.Add("Correo Electrnico")
cbonombdecurso.Items.Add("Ingles Tcnico")
cbonombdecurso.SelectedIndex = 0
End Select
Nuevo()
txtprofesor.Text = ""
txtprofesor.Focus()
Funcin Nuevo
Function Nuevo()
cbotipodecurso.Items.Clear()
cbonombdecurso.Items.Clear()
cbotipodecurso.Items.Add("Aplicativos")
cbotipodecurso.Items.Add("Programacin")
cbotipodecurso.Items.Add("Otros")
cbonombdecurso.Items.Add("Windows Vista")
cbonombdecurso.Items.Add("Word")
cbonombdecurso.Items.Add("Excel")
cbonombdecurso.Items.Add("Point")
cbotipodecurso.SelectedIndex = 0
cbonombdecurso.SelectedIndex = 0
End Function
Control ComboBox: Este control nos permite mostrar una serie de lista de
elementos para escoger, igual que el control Combo en Visual Basic 6.0. Para
insertar los elementos tendremos que dar clic en la opcin tems de la ventana de
propiedades, igual que muchos elementos que veremos en adelante y hemos visto.
Ventana de Propiedades
Aplicacin N 32
Este Formulario nos permite realizar una pro forma de compra de una
computadora, mostrndonos el precio de la computadora, impresora, el subtotal,
IGV y el total a pagar.
Control Name
TextBox1 txtcliente
TextBox2 txtdireccion
Label2 lblfecha
Label7 lblpreccomp
Label8 lblprecimp
Label9 lblsubtotal
Label10 lbligv
Label11 lbltotal
ComboBox1 cbocomputadoras
ComboBox2 cboimpresoras
Button1 btncalcular
Button2 btnotra
Button3 btnsalir
Paso N 3: Codificar.
Me.Close()
cbocomputadoras.Items.Clear()
cboimpresoras.Items.Clear()
cbocomputadoras.Items.Add("IBM")
cbocomputadoras.Items.Add("Packer Bell")
cbocomputadoras.Items.Add("Acer")
cboimpresoras.Items.Add("Epson LX-300")
cboimpresoras.Items.Add("Deskject 400")
cboimpresoras.Items.Add("IBM graphics")
cbocomputadoras.SelectedIndex = 0
cboimpresoras.SelectedIndex = 0
lblfecha.Text = "Fecha " & Format(Now, "dd/MM/yyyy")
Borrar()
Index = cbocomputadoras.SelectedIndex
Select Case Index
Case 0
lblpreccomp.Text = "850.00"
Case 1
lblpreccomp.Text = "700.00"
Case 2
lblpreccomp.Text = "600.00"
End Select
Index = cboimpresoras.SelectedIndex
Select Case Index
Case 0
lblprecimp.Text = "180.00"
Case 1
lblprecimp.Text = "270.00"
Case 2
lblprecimp.Text = "380.00"
End Select
Borrar()
Funcin Borrar
Function Borrar()
txtcliente.Text = ""
txtdireccion.Text = ""
lblpreccomp.Text = ""
lblprecimp.Text = ""
lblsubtotal.Text = ""
lbligv.Text = ""
lbltotal.Text = ""
cbocomputadoras.SelectedIndex = 0
cboimpresoras.SelectedIndex = 0
txtcliente.Focus()
End Function
Aplicacin N 33
Control Name
TextBox1 txtnombre
TextBox2 txttiempest
TextBox3 txtnumest
Label3 lblsueldo
Label4 lblestado
Label5 lbltiempoest
RadioButton1 rdbsoltero
RadioButton2 rdbcasado
Button1 btnnuevo
Button2 btnsalir
Paso N 3: Codificar.
Me.Close()
Iniciar()
Iniciar()
Funcin Iniciar
Function Iniciar()
txtnombre.Text = ""
txttiempest.Text = ""
txtnumest.Text = ""
rdbsoltero.Checked = True
lblestado.Text = "N de Hermanos"
lblsueldo.Text = "200.00"
lbltiempoest.Text = "Edad"
txtnombre.Focus()
End Function
Aplicacin N 34
Control Name
Label2 lblcurso
Label3 lblnombre
Timer tmrpresentacion
Button1 btnok
Paso N 3: Codificar.
Me.Close()
Dim J, k As Integer
Static X1, X2, Y As Integer
If X1 > 180 Xor X2 < 440 Xor Y > 212 Then
X1 = 12
X2 = 608
Y = 44
End If
X1 = X1 + 4
X2 = X2 - 4
Y=Y+4
lblcurso.Location = New Point(X1, Y)
lblnombre.Location = New Point(X2, Y)
Aplicacin N 35
Este pequeo programa nos enseara a como utilizar los colores y el tipo de
presentacin de un label.
Control Name
Label1 lbltexto
CheckedBox1 chknegrita
CheckedBox2 chksubrayado
CheckedBox3 chkcursiva
ComboBox1 cbocolor
Button1 btnsalir
Paso N 3: Codificar.
Me.Close()
Funcion Fuente
Function Fuente()
If chknegrita.Checked = True AndAlso chksubrayado.Checked = True AndAlso
chkcursiva.Checked = True Then
lbltexto.Font = New Font(lbltexto.Font, FontStyle.Bold + FontStyle.Italic +
FontStyle.Underline)
ElseIf chknegrita.Checked = True AndAlso chksubrayado.Checked = True
Then
lbltexto.Font = New Font(lbltexto.Font, FontStyle.Bold +
FontStyle.Underline)
ElseIf chknegrita.Checked = True AndAlso chkcursiva.Checked = True Then
lbltexto.Font = New Font(lbltexto.Font, FontStyle.Bold + FontStyle.Italic)
ElseIf chknegrita.Checked = False AndAlso chksubrayado.Checked = True
AndAlso chkcursiva.Checked = True Then
lbltexto.Font = New Font(lbltexto.Font, FontStyle.Underline +
FontStyle.Italic)
ElseIf chknegrita.Checked = False AndAlso chksubrayado.Checked = True
Then
lbltexto.Font = New Font(lbltexto.Font, FontStyle.Underline)
ElseIf chknegrita.Checked = False AndAlso chkcursiva.Checked = True Then
lbltexto.Font = New Font(lbltexto.Font, FontStyle.Italic)
ElseIf chknegrita.Checked = True Then
lbltexto.Font = New Font(lbltexto.Font, FontStyle.Bold)
Else
lbltexto.Font = New Font(lbltexto.Font, FontStyle.Regular)
End If
End Function
Fuente()
Fuente()
Fuente()
cbocolor.Items.Add("Negro")
cbocolor.Items.Add("Rojo")
cbocolor.Items.Add("Azul")
cbocolor.Items.Add("Verde")
cbocolor.Items.Add("Rosado")
cbocolor.Items.Add("Blanco")
cbocolor.Items.Add("Amarillo")
cbocolor.Items.Add("Anaranjado")
cbocolor.SelectedIndex = 0
Aplicacin N 36
Control Name
Label6 lblprecio
Label7 lbldescuento
Label9 lbltotal
CheckedBox1 chkdescuento
ListBox1 lstdestino
TextBox1 chkcursiva
TextBox2 chknegrita
Button1 btnnuevo
Button2 btnsalir
Paso N 3: Codificar.
Me.Close()
lstdestino.Items.Add("Lima")
lstdestino.Items.Add("Chimbote")
lstdestino.Items.Add("Trujillo")
lstdestino.Items.Add("Piura")
lstdestino.Items.Add("Tumbes")
Limpiar()
Limpiar()
Funcion Limpiar
Function Limpiar()
txtpasajero.Text = ""
txtdni.Text = ""
lblprecio.Text = ""
lbldescuento.Text = ""
lbltotal.Text = ""
chkdescuento.Checked = False
lstdestino.SelectedIndex = 0
txtpasajero.Focus()
End Function
Control TabControl: Este control, como en el Visual Basic 6.0 nos permite colocar
controles en cada pagina que creamos, para crear una pgina en el TabControl, nos
ubicaremos en la propiedad TabPages de la ventana de propiedades del control, y le
daremos clic.
Aplicacin N 37
Control Name
Label5 lbledad
Label11 lblfaltas
Label15 lblsueldo
Label17 lbldescuento
Label19 lbladelanto
Label21 lblfecha
Label23 lbltotal
TrackBar1 tkbfaltas
TabControl TabControl
TextBox1 txtnombre
ComboBox1 cbocargo
ComboBox2 cbocondicion
NumericUpDonw1 nuddia
NumericUpDonw2 nudmes
NumericUpDonw3 nudao
NumericUpDonw4 nudadelanto
DateTimePicker1 dtpfecha
Button1 btncalcular
Paso N 3: Codificar.
lblfaltas.Text = (tkbfaltas.Value).ToString
Aplicacin N 38
Este programa nos calculara recibo a emitir tras una matricula, para esto
cumplir las siguientes caractersticas:
Condicin:
Categora:
Control Name
Label6 lblcondicion
Label8 lblcategoria
Label10 lblmatricula
Label12 lblcargo
Label14 lbldescuento
Label16 lbltotal
TextBox1 txtalumno
TextBox2 txtcodigo
ComboBox1 cbocondicion
ComboBox2 cbocatgoria
ComboBox3 cboturno
NumericUpDonw1 nudcargo
NumericUpDonw2 nuddia
NumericUpDonw3 nudao
DomainUpDonw1 dudmes
DateTimePicker1 dtpfecha
ProgressBar1 pgbavance
Button1 btnprocesar
Paso N 3: Codificar.
Dim J, K As Integer
For J = 0 To 100
For K = 0 To 500000
Next
pgbavance.Value = J
Next
Select Case cbocondicion.SelectedIndex
Case 0
lblmatricula.Text = "200.00"
lblcondicion.Text = cbocondicion.SelectedItem
Case 1
lblmatricula.Text = "300.00"
lblcondicion.Text = cbocondicion.SelectedItem
Case 2
lblmatricula.Text = "400.00"
lblcondicion.Text = cbocondicion.SelectedItem
End Select
Select Case cbocategoria.SelectedIndex
Case 0
lbldescuento.Text = "0.00"
lblcategoria.Text = cbocategoria.SelectedItem
Case 1
lbldescuento.Text = Format(Val(lblmatricula.Text) * 0.25,
"###,##0.00")
lblcategoria.Text = cbocategoria.SelectedItem
Case 2
lbldescuento.Text = Format(Val(lblmatricula.Text) * 0.5,
"###,##0.00")
lblcategoria.Text = cbocategoria.SelectedItem
End Select
lblcargo.Text = Format(nudcargo.Value * 10, "###,##0.00")
lbltotal.Text = Format(Val(lblmatricula.Text) + Val(lblcargo.Text) -
Val(lbldescuento.Text), "###,##0.00")
Aplicacin N 39
Control Name
LinkLabel1 lblsalir
MaskEdBox1 MaskEdBox1
MaskEdBox2 MaskEdBox2
Paso N 3: Codificar.
Me.Close()
Aplicacin N 40
Control Name
TextBox1 txtce
TextBox2 txtespecialidad
TextBox3 txtciclo
TextBox4 txtturno
TextBox5 txtaula
Button1 btnnuevo
Button2 btnsalir
Paso N 3: Codificar.
txtce.Text = ""
txtespecialidad.Text = ""
txtciclo.Text = ""
txtturno.Text = ""
txtaula.Text = ""
txtce.Focus()
Control Name
Timer1 txtce
Label1 txtespecialidad
Label2 txtciclo
Button1 btnok
Button1 btnCancelar
Paso N 3: Codificar.
Me.Close()
Control Name
TextBox1 txtapoderado
TextBox2 txtnumherm
TextBox3 txtorigen
TextBox4 txtvivienda
Button1 btnnuevo
Button2 btnsalir
Paso N 3: Codificar.
txtapoderado.Text = ""
txtnumherm.Text = ""
txtorigen.Text = ""
txtvivienda.Text = ""
txtapoderado.Focus()
Control Name
Button1 btndatopers
Button2 btndatoacad
Button3 btndatofam
Button4 btnsalir
Paso N 3: Codificar.
End
Control Name
TextBox1 txtusuario
TextBox1 txtpassword
Button1 btnok
Button1 btncancelar
Paso N 3: Codificar.
End
Control Name
TextBox1 txtnombre
TextBox2 txtdireccion
TextBox3 txttelefono
TextBox4 txtfecnac
TextBox5 txtsexo
Button1 btnnuevo
Button2 btnsalir
Paso N 3: Codificar.
txtnombre.Text = ""
txtdireccion.Text = ""
txttelefono.Text = ""
txtfecnac.Text = ""
txtsexo.Text = ""
txtnombre.Focus()
Aplicacin N 41
Control Name
TextBox1 txtnombre
TextBox2 txtedad
TextBox3 txtdistrito
TextBox4 txtsexo
Button1 btnadicionar
Button2 btnregistros
Button3 btnsalir
Paso N 3: Codificar.
End
Funcin Activar
Function Activar()
If txtnombre.Text = "" Or txtedad.Text = "" Or txtdistrito.Text = "" Or
txtsexo.Text = "" Or IsNumeric(txtedad.Text) = False Then
btnadicionar.Enabled = False
Else
If txtsexo.Text = "F" Or txtsexo.Text = "M" Then
btnadicionar.Enabled = True
Else
MsgBox("Debe de Ingresar Los Datos Correctos Sexo (M/F)",
MsgBoxStyle.Information, "Error")
txtsexo.Text = ""
txtsexo.Focus()
End If
End If
End Function
Activar()
Activar()
Activar()
Activar()
Activar()
Formulario.lstnombre.Items.Add(txtnombre.Text)
Formulario.lstedad.Items.Add(txtedad.Text)
Formulario.lstdistrito.Items.Add(txtdistrito.Text)
Formulario.lstsexo.Items.Add(txtsexo.Text)
txtnombre.Text = ""
txtedad.Text = ""
txtdistrito.Text = ""
txtsexo.Text = ""
txtnombre.Focus()
Formulario.Show()
Me.Hide()
Control Name
ListBox1 lstnombre
ListBox1 lstedad
ListBox1 lstdistrito
ListBox1 lstsexo
Button1 btnmodificar
Button2 btneliminar
Button3 btnsalir
Paso N 3: Codificar.
End
Index = lstnombre.SelectedIndex
lstedad.SelectedIndex = Index
lstdistrito.SelectedIndex = Index
lstsexo.SelectedIndex = Index
btneliminar.Enabled = True
Index = lstedad.SelectedIndex
lstnombre.SelectedIndex = Index
lstdistrito.SelectedIndex = Index
lstsexo.SelectedIndex = Index
btneliminar.Enabled = True
Index = lstdistrito.SelectedIndex
lstedad.SelectedIndex = Index
lstnombre.SelectedIndex = Index
lstsexo.SelectedIndex = Index
btneliminar.Enabled = True
Index = lstsexo.SelectedIndex
lstedad.SelectedIndex = Index
lstdistrito.SelectedIndex = Index
lstnombre.SelectedIndex = Index
btneliminar.Enabled = True
Control ListView: Este control, bueno para mi es nuevo ya que recin lo veo en
esta versin, aunque no crean es muy fcil de utilizar, para agregar tems al
control, nos dirigiremos a la propiedad tems, pero primero seleccionaremos el
objeto de donde utilizaremos las imgenes para mostrar en el control, esto se har
en la propiedad LargeImageList.
Igual que otros editores de Coleccin (tems) tendremos que darle clic en
agregar y de ah seleccionaremos en ImageIndex la imagen que queremos que se
muestre en ese Item y en la propiedad Text escribiremos el texto que se muestre
con la imagen, si se han dado cuenta un Item puede tener un SubItem, solo tedrian
que darle clic en la propiedad SubItems de la ventana de propiedades del Item en
donde desean agregar un SubItmen
Control TreeView: Este control como en la versin anterior, es muy utilizado para
crear ayuda y tendremos que hacer lo mismo que hicimos en el control anterior,
para insertar Nodo.
Aplicacin N 43
Control Name
Label1 lblelegido
Label2 lblseleccion
Button1 btnsalir
Paso N 3: Codificar.
lblseleccion.Text = e.Node.Text
Me.Close()
Bueno se que esta entrega debera incluir formularios MDI, pero no me alcanzo
el tiempo, pero no se preocupen que ya lo veremos en la prxima entrega, y espero
que les sea de bastante utilidad esta entrega, ya saben que para cualquier cosa
esta mi correo jmchm19@hotmail.com que les responder lo mas rpido posible,
bueno ya me despido, aqu en Per estamos en verano as que todos a la playa,
hasta la prxima entrega bye y cudense.
Cuenta en Soles:
067-3008573552
Cuenta en Dlares:
067-3008573560
www.interbank.com.pe