Informatica
Ministerio del Poder Popular para la Educación
E.T.C. “Norberto Prado”
Guarenas – Estado Miranda
Prof. Ernesto Del Nogal y Noel Meléndez
Programación IIGuía de Promedio en Visual Basic 6.0
Formulario
Propiedades del formulario
Códigos
Option Explicit
Dim Nota() As Single
Dim N As Integer'Número total de notas.
____________________________________________________________________________
Private Sub Command1_Click()
If Text1.Text = "" Then'Si no se han introducido nota.
MsgBox "No se ha introducido una nota"
Text1.SetFocus
Exit Sub
End If
N = N + 1'Inicializa el conteo de las notas entradas.
ReDim Preserve Nota(1 To N) 'Redimesiona el arreglo.
Nota(N) = Text1.Text'Asigna el valor al arreglo.
List1.AddItem (Nota(N)) 'Añade la nota a la lista.
Command1.Enabled = False
End Sub________________________________________________________________________________
Private Sub Command2_Click()
Dim i As Integer, NotaInd As Integer
NotaInd = List1.ListIndex + 1 'Asigna el orden del elemento dela lista a una variable.
If List1.ListIndex = -1 Then 'Si no esta checheada la lista.
MsgBox "Haga click en la lista para borrar la nota"
Exit SubElse
List1.RemoveItem (List1.ListIndex) 'Borra de la Lista la Nota
Text1.Text = "" 'Limpia el texto.'Eliminar la nota de indice (List1.ListIndex+1) y correr las notas
For i = NotaInd To N - 1
Nota(i) = Nota(i + 1)
Next i
N =...
Regístrate para leer el documento completo.