SCIENTIFIC CALCULATOR
Dim k As Integer
Dim A As Integer, B As Integer, C As Integer, Y As Integer, X As Integer, P1 As Integer, Q1 As Integer, R1 As Integer, P2 As Integer, Q2 As Integer, R2 As Integer, P3 As Integer, Q3 As Integer, R3 As Integer, P4 As Integer, Q4 As Integer, R4 As Integer, P5 As Integer, Q5 As Integer, R5 As Integer, P6 As Integer, Q6 As Integer, R6 As Integer
Private Sub Command1_Click()
Text1.Text = Text1.Text & 1
End Sub
Private Sub Command10_Click()
Text1.Text = Text1.Text & 0
End Sub
Private Sub Command11_Click()
A = CInt(Text1.Text)
Text1.Text = ""
Y = 1
End Sub
Private Sub Command12_Click()
A = CInt(Text1.Text)
Text1.Text = ""
Y = 2
End Sub
Private Sub Command13_Click()
A = CInt(Text1.Text)
Text1.Text = ""
Y = 3
End Sub
Private Sub Command14_Click()
A = CInt(Text1.Text)
Text1.Text = ""
Y = 4
End Sub
Private Sub Command15_Click()
B = CInt(Text1.Text)
Select Case Y
Case 1
C = A + B
Text1.Text = C
Case 2
C = A - B
Text1.Text = C
Case 3
C = A * B
Text1.Text = C
Case 4
C = A \ B
Text1.Text = C
Case 5
C = A ^ B
Text1.Text = C
End Select
End Sub
Private Sub Command16_Click()
Text1.Text = Text1.Text & 0 & 0
End Sub
Private Sub Command17_Click()
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
End Sub
Private Sub Command18_Click()
Text1.Text = Text1.Text / 100
End Sub
Private Sub Command19_Click()
Text1.Text = ""
End Sub
Private Sub Command2_Click()
Text1.Text = Text1.Text & 2
End Sub
Private Sub Command20_Click()
End
End Sub
Private Sub Command21_Click()
Text1.Text = Log(Text1.Text)
End Sub
Private Sub Command22_Click()
A = CInt(Text1.Text)
Text1.Text = ""
Y = 5
End Sub
Private Sub Command23_Click()
Text1.Text = Sin(Text1.Text)
End Sub
Private Sub Command24_Click()
Text1.Text = Cos(Text1.Text)
End Sub
Private Sub Command25_Click()
Text1.Text = Tan(Text1.Text)
End Sub
Private Sub Command26_Click()
Text1.Text = Text1.Text + "."
Y = 6
End Sub
Private Sub Command27_Click()
Text1.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
End Sub
Private Sub Command28_Click()
Text1.BackColor = RGB(255, 0, 0)
End Sub
Private Sub Command29_Click()
Text1.BackColor = RGB(0, 255, 0)
End Sub
Private Sub Command3_Click()
Text1.Text = Text1.Text & 3
End Sub
Private Sub Command30_Click()
Text1.BackColor = RGB(0, 0, 255)
End Sub
Private Sub Command31_Click()
Frame1.BackColor = RGB(255, 0, 0)
End Sub
Private Sub Command32_Click()
Frame1.BackColor = RGB(0, 255, 0)
End Sub
Private Sub Command33_Click()
Frame1.BackColor = RGB(0, 0, 255)
End Sub
Private Sub Command34_Click()
Frame1.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
End Sub
Private Sub Command35_Click()
If Frame2.Height = 0 And Frame2.Width = 0 Then
Frame2.Height = 6615 And Frame2.Width = 7695
ElseIf Frame2.Height = 6615 And Frame2.Width = 7695 Then
Frame2.Height = 0 And Frame2.Width = 0
End If
If Frame2.Height = 6615 And Frame2.Width = 7695 Then
Frame2.Height = 0 And Frame2.Width = 0
ElseIf Frame2.Height = 0 And Frame2.Width = 0 Then
Frame2.Height = 6615 And Frame2.Width = 7695
End If
End Sub
Private Sub Command36_Click()
Command36.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
P1 = CInt(Text2.Text)
Q1 = CInt(Text3.Text)
R1 = CInt(Text4.Text)
End Sub
Private Sub Command37_Click()
Text1.BackColor = RGB(Val(P2), Val(Q2), Val(R2))
End Sub
Private Sub Command38_Click()
Command38.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
P2 = CInt(Text2.Text)
Q2 = CInt(Text3.Text)
R2 = CInt(Text3.Text)
End Sub
Private Sub Command39_Click()
Text1.BackColor = RGB(P1, Q1, R1)
End Sub
Private Sub Command4_Click()
Text1.Text = Text1.Text & 4
End Sub
Private Sub Command40_Click()
Frame2.Height = 6615
Frame2.Width = 7695
End Sub
Private Sub Command41_Click()
Command41.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
P3 = CInt(Text2.Text)
Q3 = CInt(Text3.Text)
R3 = CInt(Text3.Text)
End Sub
Private Sub Command42_Click()
k = k + 1
If k Mod 2 = 0 Then
Form1.Height = 7575
Form1.Width = 6735
Else
Form1.Height = 7575
Form1.Width = 14790
End If
End Sub
Private Sub Command43_Click()
Text1.BackColor = RGB(Val(P3), Val(Q3), Val(R3))
End Sub
Private Sub Command44_Click()
Command44.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
P4 = CInt(Text2.Text)
Q4 = CInt(Text3.Text)
R4 = CInt(Text3.Text)
End Sub
Private Sub Command45_Click()
Command45.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
P5 = CInt(Text2.Text)
Q5 = CInt(Text3.Text)
R5 = CInt(Text3.Text)
End Sub
Private Sub Command46_Click()
Command46.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
P6 = CInt(Text2.Text)
Q6 = CInt(Text3.Text)
R6 = CInt(Text3.Text)
End Sub
Private Sub Command49_Click()
Text1.BackColor = RGB(Val(P4), Val(Q4), Val(R4))
End Sub
Private Sub Command5_Click()
Text1.Text = Text1.Text & 5
End Sub
Private Sub Command50_Click()
Text1.BackColor = RGB(Val(P5), Val(Q5), Val(R5))
End Sub
Private Sub Command51_Click()
Text1.BackColor = RGB(Val(P6), Val(Q6), Val(R6))
End Sub
Private Sub Command6_Click()
Text1.Text = Text1.Text & 6
End Sub
Private Sub Command7_Click()
Text1.Text = Text1.Text & 7
End Sub
Private Sub Command8_Click()
Text1.Text = Text1.Text & 8
End Sub
Private Sub Command9_Click()
Text1.Text = Text1.Text & 9
End Sub
Private Sub Form_Load()
k = 0
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
Frame1.BackColor = RGB(255, 0, 0)
End Sub
Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)
Frame2.BackColor = RGB(255, 0, 0)
End Sub
Private Sub HScroll1_Change()
Text2.Text = HScroll1.Value
Text11.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
End Sub
Private Sub HScroll2_Change()
Text3.Text = HScroll2.Value
Text11.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
End Sub
Private Sub HScroll3_Change()
Text4.Text = HScroll3.Value
Text11.BackColor = RGB(Val(Text2.Text), Val(Text3.Text), Val(Text4.Text))
End Sub
Private Sub Text11_Change()
Text11.BackColor = RGB(Val(HScroll1.Value), Val(HScroll2.Value), Val(HScroll3.Value))
End Sub
No comments:
Post a Comment