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