Pregunta: | 67531 - ¿CALCULAR PARA VISUAL BASIC 6.0? |
Autor: | SOL lopez |
Dim G, M, R, C As Double Private Sub Calcular_Click() If (G = 0) And (M = 0) Then r1 = M / C Ventana.Print "La formula es degenerada" ElseIf (G = 0) And (M <> 0) Then R = G * M / C Ventana.Print " r1=" & r1 Else R = 2 * G * M / C ^ 2 If R >= 0 Then r1 = (2 * G * M) / (C ^ 2) Ventana.Print "r1=" & r1 Else real = (C ^ 2) Label4.Caption = (2 * G * M) / (C ^ 2) End If End If End Sub Private Sub Form_Load() Dim G, M, C, r1, real, compleja, R As Double G = InputBox("G="): M = InputBox("M="): C = InputBox("C=") Label1.Caption = "R = (2 * g * m) / (c ^ 2)=" End Sub Private Sub Salir_Click() End End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Text2.SetFocus M = Val(Text1.Text) End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Text3.SetFocus G = Val(Text2.Text) End If End Sub Private Sub Text3_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Text4.SetFocus C = Val(Text3.Text) End If End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Text1.SetFocus End If End Sub quiesira que me ayudara a que me diera el resultado el programa funcina bien pero a la hora de ponerce el resultado aparece otra cosa en vez del resultado le puse todo el programa completo para que les sea mas facil de resolver |