Manual de Visual Basic Intermedio

 

  Lección: 10

 

Capítulo: Ejercicio 10: Inter Compras Net

 

 

Crea un formulario con siete etiquetas, cinco cuadros image, un botón y escribe el siguiente código:

 

Dim total As Double

 

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)

 

Source.Move X, Y

 

End Sub

 

El botón Cuenta Nueva

 

Private Sub Command1_Click()

 

Label7 = ""

 

total = o

 

End Sub

 

Private Sub Image5_DragDrop(Source As Control, X As Single, Y As Single)

 

If Source = Image1 Then

 

total = total + 250#

 

ElseIf Source = Image2 Then

 

total = total + 375#

 

ElseIf Source = Image3 Then

 

total = total + 400#

 

ElseIf Source = Image4 Then

 

total = total + 500#

 

End If

 

Label7 = "$" & total & ".00"

 

End Sub

 

   Volver al índice!