Programas De Vb 6.0
Enviado por IvanSanchez2208 • 3 de Junio de 2015 • 1.268 Palabras (6 Páginas) • 273 Visitas
Universidad del Valle de Atemajac
Campus Puerto Vallarta
ME.LSC. Adam Ramiro Arredondo Bernal
Software de Sistemas
Portafolio 3er Parcial
Marcos Ivan Morales Sánchez
Cuatrimestre 2015-2 LISC
Puerto Vallarta, Jalisco. A 14 de Abril de 2015
Agenda sencilla (Inputbox)
Private Sub Command1_Click()
Open "Ejemplo2.txt" For Append As #1
a$ = InputBox("Entra nuevo Nombre", "Nombre")
Print #1, a$
a$ = InputBox("Entra nuevo Email", "Email")
Print #1, a$
a$ = InputBox("Entra nuevo Telefono", "Telefono")
Print #1, a$
Close #1
End Sub
Private Sub Command2_Click()
Open "Ejemplo2.txt" For Input As #1
While Not (EOF(1))
Input #1, a$
Print a$
Wend
Print ""
Close #1
End Sub
Private Sub Command3_Click()
Cls
Open "Ejemplo2.txt" For Input As #1
a$ = InputBox("Entra nombre a buscar:", "Nombre")
While Not (EOF(1))
Input #1, nombre$
Input #1, Telefono$
Input #1, Email$
If UCase$(a$) = Left$(UCase$(nombre), Len(a$)) Then
Print "Dato Encontrado"
Print "Nombre:", nombre$ Print "Telefono", Telefono$
Print "Email:", Email$
End If
Wend
Close #1
End Sub
Agenda (Textbox)
Private Sub Command1_Click()
Open "Ejemplo2.txt" For Append As #1
a$ = MsgBox("¿Desea guardar los datos?", vbYesNo, "Guardar")
If a$ = vbYes And Text1.Text <> "" Then
Print #1, Text1.Text
Print #1, Text2.Text
Print #1, Text3.Text
End If
Close #1
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Call Form_Load
End Sub
Private Sub Form_Load()
On Error GoTo Salir (Abajo) List1.Clear
Open "Ejemplo2.txt" For Input As #1
While Not (EOF(1))
Input #1, a$
Input #1, b$
Input #1, c$
List1.AddItem a$
Wend
Close #1
Salir:
End Sub
Private Sub List1_DblClick()
Open "Ejemplo2.txt" For Input As #1
Input #1, a$
Input #1, b$
Input #1, c$
a$ = MsgBox("Nombre:" + a$ + Chr$(13) + "Telefono:" + b$ + Chr$(13) + "Email:" + c$ + Chr$(13), vbOKOnly, "Dato Encontrado")
Close #1
End Sub
Private Sub Text4_Change()
Cls
Open "Ejemplo2.txt" For Input As #1
a$ = Text4.Text
List1.Clear
While Not (EOF(1))
Input #1, a$
Input #1, b$
Input #1, c$
If UCase$(Text4.Text) = Left$(UCase$(a$), Len(Text4.Text)) Then
List1.AddItem a$
End If
Wend
Close #1
End Sub
Tienda (Registro y Ventas)
Private Sub Command1_Click()
Open "productos.txt" For Append As #1
a$ = MsgBox("¿Desea guardar los datos?", vbYesNo, "Guardar")
If a$ = vbYes And Text1.Text <> "" Then
Print #1, Text1.Text
Print #1, Text2.Text
Print #1, Text3.Text
End If
Close #1
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Call Form_Load
End Sub
Private Sub Command2_Click()
If Text5.Text <> "" And Text6.Text <> "" And Text7.Text <> "" And Text8.Text <> "" And Text9.Text <> "" Then
Open "ventas.txt" For Append As #1
Print #1, Text10.Text 'fecha
Print #1, Text11.Text 'hora
Print #1, Text5.Text 'cantidad
Print #1, Text7.Text 'producto
Print #1, Text8.Text 'precio u
Print #1, Text9.Text 'monto
Close #1
List2.AddItem Text5.Text
...