Oppure

Loading
26/09/11 17:52
karl93
Ecco il codice:

Option Explicit
Dim A, B
Dim lastTxt As TextBox

Private Sub Command1_Click()
A = Val(Text1.Text)
B = Val(Text2.Text)

If Option1.Value = True Then
Text3.Text = A + B
ElseIf Option2.Value = True Then
Text3.Text = A - B
ElseIf Option3.Value = True Then
Text3.Text = A * B
ElseIf Option4.Value = True Then
Text3.Text = A \ B
ElseIf Option5.Value = True Then
Text3.Text = A / B
ElseIf Option6.Value = True Then
Text3.Text = A Mod B
End If
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
Text1.SetFocus

End Sub

Private Sub Command3_Click()
End

End Sub



Private Sub Text1_LostFocus()
Set lastTxt = Text1
End Sub

Private Sub Text2_LostFocus()
Set lastTxt = Text2
End Sub
aaa
26/09/11 17:54
Manca il codice del click del tasto "1" ...
26/09/11 17:58
karl93
Ho scritto:

Private Sub cmdTasto1_Click()
Text1.Text = 1

Text2.Text = 1
End Sub


Ovviamente non è così, perchè in questo modo scrive contemporanemente in tutte e due le TextBox. Cosa devo modificare?
aaa
26/09/11 18:02
Io non ti avevo scritto così .. se non segui quello che ti viene suggerito si perde solo tempo ...
26/09/11 18:08
karl93
Scusa ma non avevo letto bene. Sorry. Funziona tutto perfettamente.
Grazie mille :D
aaa