Hola!!
Estos son los codigos de los ejercicios mas comunes y faciles de Visual Basic 6.0
El botón Nuevo Cálculo
Private Sub Command5_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
El botón Sumar
Private Sub Command1_Click()
Text3 = Val(Text1) + Val(Text2)
End Sub
El botón Restar
Private Sub Command2_Click()
Text3 = Val(Text1) - Val(Text2)
End Sub
El botón Multiplicar
Private Sub Command3_Click()
Text3 = Val(Text1) * Val(Text2)
End Sub
El botón Dividir
Private Sub Command4_Click()
Text3 = Val(Text1) / Val(Text2)
End Sub
El botón Salir
Private Sub Command6_Click()
Unload Me
End
End Sub
El botón Calcular
Private Sub Command1_Click()
If Option1 = True Then
Text3 = Val(Text1) / Val(Text2)
ElseIf Option2 = True Then
Text3 = Val(Text1) * Val(Text2)
ElseIf Option3 = True Then
Text3 = Val(Text1) - Val(Text2)
ElseIf Option4 = True Then
Text3 = Val(Text1) + Val(Text2)
End If
End Sub
El botón Otra Operación
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
El botón Convertir
Private Sub Command1_Click()
If Option1 = True Then
Text2 = Val(Text1) * 1000
ElseIf Option2 = True Then
Text2 = Val(Text1) * 100
ElseIf Option3 = True Then
Text2 = Val(Text1) * 10
ElseIf Option4 = True Then
Text2 = Val(Text1) / 1000
End If
End Sub
El botón Ver Tabla
Private Sub Command1_Click()
Dim res As Long, retorno
For n = 1 To 10
res = Text1 * n
retorno = Chr(13) & Chr(10)
Text2 = Text2 & Text1 & " x " & n & " = " & res & retorno
Next n
End Sub
El botón Salir
If MsgBox("Por Favor Confirma Si Ya Te Quieres Ir", vbYesNo, "¿Qué Ya Te Quieres Ir?"
= vbYes Then
End
Else
Cancel = 1
End If
Boton salir
Private Sub cmbSalir_Click()
Beep
End
End Sub
Private Sub mnuFileExit_Click()
End
End Sub
Barra
Private Sub vsbTemp_Change()
txtCent.Text = vsbTemp.Value
txtFahr.Text = 32 + 1.8 * vsbTemp.Value
End Sub
Bueno espero q les sirvan tanto como en algun momento me sirvio a mi

link de mas posts :
Estos son los codigos de los ejercicios mas comunes y faciles de Visual Basic 6.0
EJERCICIO DE LA CALCULADORA
El botón Nuevo Cálculo
Private Sub Command5_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
El botón Sumar
Private Sub Command1_Click()
Text3 = Val(Text1) + Val(Text2)
End Sub
El botón Restar
Private Sub Command2_Click()
Text3 = Val(Text1) - Val(Text2)
End Sub
El botón Multiplicar
Private Sub Command3_Click()
Text3 = Val(Text1) * Val(Text2)
End Sub
El botón Dividir
Private Sub Command4_Click()
Text3 = Val(Text1) / Val(Text2)
End Sub
El botón Salir
Private Sub Command6_Click()
Unload Me
End
End Sub
EJERCICIO CALCULADORA 2
El botón Calcular
Private Sub Command1_Click()
If Option1 = True Then
Text3 = Val(Text1) / Val(Text2)
ElseIf Option2 = True Then
Text3 = Val(Text1) * Val(Text2)
ElseIf Option3 = True Then
Text3 = Val(Text1) - Val(Text2)
ElseIf Option4 = True Then
Text3 = Val(Text1) + Val(Text2)
End If
End Sub
El botón Otra Operación
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
EJERCICIO CONVERSIONES
El botón Convertir
Private Sub Command1_Click()
If Option1 = True Then
Text2 = Val(Text1) * 1000
ElseIf Option2 = True Then
Text2 = Val(Text1) * 100
ElseIf Option3 = True Then
Text2 = Val(Text1) * 10
ElseIf Option4 = True Then
Text2 = Val(Text1) / 1000
End If
End Sub
EJERCICIO TABLAS
El botón Ver Tabla
Private Sub Command1_Click()
Dim res As Long, retorno
For n = 1 To 10
res = Text1 * n
retorno = Chr(13) & Chr(10)
Text2 = Text2 & Text1 & " x " & n & " = " & res & retorno
Next n
End Sub
El botón Salir
If MsgBox("Por Favor Confirma Si Ya Te Quieres Ir", vbYesNo, "¿Qué Ya Te Quieres Ir?"

= vbYes Then
End
Else
Cancel = 1
End If
EJERCICIO TERMOMETRO
Boton salir
Private Sub cmbSalir_Click()
Beep
End
End Sub
Private Sub mnuFileExit_Click()
End
End Sub
Barra
Private Sub vsbTemp_Change()
txtCent.Text = vsbTemp.Value
txtFahr.Text = 32 + 1.8 * vsbTemp.Value
End Sub
Bueno espero q les sirvan tanto como en algun momento me sirvio a mi

link de mas posts :