Red de conocimiento informático - Descarga de software - Utilice VB para crear operaciones aritméticas de cuatro dígitos cualesquiera, buscando expertos

Utilice VB para crear operaciones aritméticas de cuatro dígitos cualesquiera, buscando expertos

¿Dim?X?As?Single,?Y?As?Single,?FH?As?String

Privado?Sub?Command1_Click(Index?As?Integer)

Dim?K?As?Integer

K?=?Command1(Index).Index

Si?K?lt;gt;?10?Then

Si?Derecha(Texto1.Texto,?1)?=?"."?Entonces

Texto1.Texto?=?Texto1.Texto?amp;?K

ElseIf?Int(Val(Text1.Text))?=?Val(Text1.Text)?And?Right(Text1.Text,?1)?lt;gt;?"."?Entonces

Texto1.Texto?=?Val(Texto1.Texto)?*?10?K

ElseIf?Int(Val(Texto1.Texto))?lt;gt;?Val(Texto1.Texto) ?Y?Derecha(Texto1.Texto,?1)?lt;gt;?"."?Entonces

Texto1.Texto?=?Texto1.Texto?amp;?K

¿Fin?Si

Else

Texto1.Text?=?Text1.Text?amp;?"."

Fin?Si

Si?FH?=?""?Entonces

X?=?Val(Text1.Text)

Si no

Y?=?Val( Texto1.Texto)

¿Fin?Si

Fin?Sub

¿Privado?Sub?Command2_Click(Índice?As?Entero)

Dim?K1?As?Integer

K1?=?Command2(Index).Index

Texto1.Text?=?""

If?Command2( K1).Caption?=?" "?Entonces

FH?=?" "

ElseIf?Command2(K1).Caption?=?"-"?Entonces

FH?=?"-"

ElseIf?Command2(K1).Caption?=?"*"?Entonces

FH?=?"*"

ElseIf?Command2(K1).Caption?=?"/"?Entonces

FH?=?"/"

Fin?If

Fin?Sub

Privado?Sub?Command3_Click()

Si?X?lt;gt;?0?Y?Y?lt;gt;?0?Entonces

Si?FH?=?" "?Entonces

Texto1.Texto?=?X ?Y

ElseIf?FH?=?"-"? Entonces

Text1.Text?=?X?-?Y

ElseIf?FH?=?"*"?Entonces

Text1.Text?=? X?*?Y

ElseIf?FH?=?"/"?Entonces

Si

?Y?=?0?Entonces

MsgBox?"El divisor no puede ser 0",?16,?"Error!"

Salir?Sub

¿Fin?Si

Texto1.Text?=?X?/?Y

Fin?Si

X?=?Val(Text1.Text)

Else

MsgBox?"¡Operandos insuficientes!",?16,?"Error!"

Fin?Si

Fin?Sub

¿Privado?Sub?Command4_Click()

Text1.Text?=?"":?X?=?0:?Y?=?0:?FH?=?""

Fin?Sub

Privado?Sub?Form_Load()

Texto1.Text?=?"":?X?=?0:?Y? =?0:?FH?=?""

Fin?Sub