코드는 다음과 같습니다:
다음과 같이 코드 코드를 복사합니다.
/**
*저자 : 블랙버드하트
*버전:1.0
*/
Dim IntX As Double '계산된 값을 저장하는 데 사용되는 전역 변수
Dim IntOperation As Double '표시 작업 유형
Dim isBegin As Boolean '태그에 IntX에 값이 할당되었는지 여부
Public Sub Clear() '지우기 명령 기능
스크린.캡션 = ""
서브 끝
공개 하위 SavaToIntX()
사례 선택 IntOperation
사례 1 '추가
isBegin = False인 경우
IntX = Val(화면.캡션)
isBegin = 참
또 다른
IntX = IntX + Val(화면.캡션)
종료 조건
사례 2 '뺄셈
isBegin = False인 경우
IntX = Val(화면.캡션)
isBegin = 참
또 다른
IntX = IntX - Val(화면.캡션)
종료 조건
사례 3 '곱셈
isBegin = False인 경우
IntX = Val(화면.캡션)
isBegin = 참
또 다른
IntX = IntX * Val(화면.캡션)
'screen.Caption = IntX
종료 조건
사례 4 '구분
isBegin = False인 경우
IntX = Val(화면.캡션)
isBegin = 참
또 다른
IntX = IntX / Val(화면.캡션)
종료 조건
선택 종료
서브 끝
개인 하위 Command0_Click()
screen.Caption = 스크린.캡션 & 0
서브 끝
개인 하위 Command1_Click()
screen.Caption = 스크린.캡션 & 1
서브 끝
개인 하위 Command2_Click()
screen.Caption = 스크린.캡션 & 2
서브 끝
개인 하위 Command3_Click()
screen.Caption = screen.Caption & 3
서브 끝
개인 하위 Command4_Click()
screen.Caption = 스크린.캡션 & 4
서브 끝
개인 하위 Command5_Click()
screen.Caption = 스크린.캡션 & 5
서브 끝
개인 하위 Command6_Click()
screen.Caption = screen.Caption & 6
서브 끝
개인 하위 Command7_Click()
screen.Caption = screen.Caption & 7
서브 끝
개인 하위 Command8_Click()
screen.Caption = 스크린.캡션 & 8
서브 끝
개인 하위 Command9_Click()
screen.Caption = screen.Caption & 9
서브 끝
Private Sub CommandClear_Click() '지우기 명령
isBegin = 거짓
IntOperation = 0
IntX = 0
스크린.캡션 = ""
서브 끝
Private Sub CommandEqual_Click() '등호 연산
If IntOperation <> 0 Then '작업 표시가 있는 경우
CallSavaToIntX
IntOperation = 0
isBegin = 거짓
screen.Caption = IntX
종료 조건
서브 끝
Private Sub CommandMinus_Click() '뺄셈 연산
If IntOperation <> 0 Then '작업 표시가 있는 경우
CallSavaToIntX
IntOperation = 2
콜 클리어
또 다른
IntOperation = 2
CallSavaToIntX
콜 클리어
종료 조건
서브 끝
Private Sub CommandMultiple_Click() '곱셈 연산
If IntOperation <> 0 Then '작업 표시가 있는 경우
CallSavaToIntX
IntOperation = 3
콜 클리어
또 다른
IntOperation = 3
CallSavaToIntX
콜 클리어
종료 조건
서브 끝
Private Sub CommandPlus_Click() '추가 작업
If IntOperation <> 0 Then '작업 표시가 있는 경우
CallSavaToIntX
IntOperation = 1
콜 클리어
또 다른
IntOperation = 1
CallSavaToIntX
콜 클리어
종료 조건
서브 끝
Private Sub CommandSlash_Click() '나누기 작업
If IntOperation <> 0 Then '작업 표시가 있는 경우
CallSavaToIntX
IntOperation = 4
콜 클리어
또 다른
IntOperation = 4
CallSavaToIntX
콜 클리어
종료 조건
서브 끝