| “Простой калькулятор” Dim op Single, dtmA As Date Private Sub Form_Load() op = 0 dtmA = Date Text4.Text = dtmA End Sub Private Sub Command1_Click() op = 1 Image1.Picture = Command1.Picture Calculate End Sub Private Sub Command2_Click() op = 2 Image1.Picture = Command2.Picture Calculate End Sub Private Sub Command3_Click() op = 3 Image1.Picture = Command3.Picture Calculate End Sub Private Sub Command4_Click() op = 4 Image1.Picture = Command4.Picture Calculate End Sub Private Sub Command5_Click() End End Sub Private Sub Text1_Change() Text1.Text = LTrim(Str(Val(Text1.Text))) Calculate End Sub Private Sub Text2_Change() Text2.Text = LTrim(Str(Val(Text2.Text))) Calculate End Sub Public Sub Calculate() If op = 1 Then Label1.Caption = Str(Val(Text1.Text) + Val(Text2.Text)) ElseIf op = 2 Then Label1.Caption = Str(Val(Text1.Text) - Val(Text2.Text)) ElseIf op = 3 Then Label1.Caption = Str(Val(Text1.Text) * Val(Text2.Text)) ElseIf op = 4 Then If Val(Text2.Text) <> 0 Then Label1.Caption = Str(Val(Text1.Text) / Val(Text2.Text)) Else Label1.Caption = "На ноль делить нельзя! " End If End If End Sub Private Sub Timer1_Timer() Text3.Text = Time$ End Sub
РОД - Главный бог славянского пантеона, творец - "родитель" вселенной, всего видимого и невидимого мира. Род - наименее персонифицированное божество славянского пантеона - "отец и мать всех богов".
|