m

moburao

Usuario (El Salvador)

Primer post: 4 jun 2009Último post: 5 sept 2011
5
Posts
30
Puntos totales
0
Comentarios
Comandos de Visual Basic Ejecicios I
Comandos de Visual Basic Ejecicios I
InfoporAnónimo1/11/2011

Ejercicio 1: Conversiones Crea un formulario con dos etiquetas, dos cajas de texto, un marco, cuatro botones de opción, tres botones y escribe el siguiente código: 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 Nuevo Cálculo Private Sub Command2_Click() Text1 = "" Text2 = "" Text1.SetFocus End Sub El botón Salir Private Sub Command3_Click() Unload Me End End Sub Ejercicio 2: Ejercicio 3:

5
1
Comandos de Visual Basic Ejecicios III
Comandos de Visual Basic Ejecicios III
InfoporAnónimo1/11/2011

Ejercicio 7: Concatenación Crea un formulario con cuatro etiquetas, cuatro cajas de texto, tres botones y escribe el siguiente código: El botón Concatenar Datos Private Sub Command1_Click() Text4 = Text1 & " " & Text2 & " " & Text3 End Sub El botón Nuevos Datos Private Sub Command2_Click() Text1 = "" Text2 = "" Text3 = "" Text4 = "" Text1.SetFocus End Sub El botón Salir del Programa Private Sub Command3_Click() Unload Me End End Sub Ejercicio 1: Ejercicio 2:

13
1
Comandos de Visual Basic
Comandos de Visual Basic
InfoporAnónimo6/4/2009

Hola!! 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 : http://new.taringa.net/posts/info/2694286/codigos-de-una-calculadora.html http://www.taringa.net/posts/info/2838958/Fotos-en-visual-basic.html

0
0
codigos de una calculadora
codigos de una calculadora
InfoporAnónimo6/4/2009

aqui les dejo los comandos para hacer una calculadora con salida y botones de acciones Visual Basic: • 2 labels (Representa al signo = y los signos de operacion) • 3 cajas de texto (2 para los numeros y una para el resultado) • 4 botones (+,-,*,/) • 2 botonesde limpieza y salir Codigo: para los signos Private Sub Form_Load() Label1 = "" Label2 = "=" Text1 = "" Text2 = "" Text3 = "" End Sub boton sumar Private Sub Command1_click() Label1 = "+" Text3 = Val(Text1) + Val(Text2) End Sub boton restar Private Sub Command2_click() Label1 = "-" Text3 = Val(Text1) - Val(Text2) End Sub boton multiplicar Private Sub Command3_click() Label1 = "*" Text3 = Val(Text1) * Val(Text2) End Sub Boton dividir Private Sub Command4_click() Label1 = "/" Text3 = Val(Text1) / Val(Text2) End Sub Ya saben que el Label1 hay que colocarlo entre Text1 y Text2 ... y el Label2 va entre Text2 y Text3 !!! En la propiedad 'Caption' de los 'Command' asignar signos de operacion ... Command1 = + Command2 = - Command3 = * Command4 = / El botón Nuevo Cálculo Private Sub Command5_Click() Text1 = "" Text2 = "" Text3 = "" Text1.SetFocus End Sub boton de salida con pregunta que quiere hacer If MsgBox("Por Favor Confirma Si Ya Te Quieres Ir", vbYesNo, "¿Qué Ya Te Quieres Ir?" = vbYes Then End Else Cancel = 1 End If espero que les sirva para un examen :

0
2
C
Comandos de Visual Basic
InfoporAnónimo9/5/2011

Hola!! 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 Barra Private Sub vsbTemp_Change() txtCent.Text = vsbTemp.Value txtFahr.Text = 32 + 1.8 * vsbTemp.Value End Sub Boton salir Private Sub cmbSalir_Click() Beep End End Sub Private Sub mnuFileExit_Click() End End Sub Bueno espero que les sirvan tanto como en algun momento me sirvio a mi Ejercicios de Visual Basic http://www.taringa.net/posts/info/8723159/Comandos-de-Visual-Basic-Ejecicios-I.html Mas posts : http://new.taringa.net/posts/info/2694286/codigos-de-una-calculadora.html http://www.taringa.net/posts/info/2838958/Fotos-en-visual-basic.html

12
11
PosteameloArchivo Histórico de Taringa! (2004-2017). Preservando la inteligencia colectiva de la internet hispanohablante.

CONTACTO

18 de Septiembre 455, Casilla 52

Chillán, Región de Ñuble, Chile

Solo correo postal

© 2026 Posteamelo.com. No afiliado con Taringa! ni sus sucesores.

Contenido preservado con fines históricos y culturales.