VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6060
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   6060
   StartUpPosition =   3  '系統預設值
   Begin VB.CommandButton Command2 
      Caption         =   "切換運算符號"
      Height          =   855
      Left            =   240
      TabIndex        =   6
      Top             =   1440
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "計算"
      Height          =   855
      Left            =   2400
      TabIndex        =   4
      Top             =   1440
      Width           =   1575
   End
   Begin VB.TextBox Text2 
      BeginProperty Font 
         Name            =   "微軟正黑體"
         Size            =   18
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   2400
      TabIndex        =   2
      Top             =   240
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "微軟正黑體"
         Size            =   15.75
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   1575
   End
   Begin VB.Label Label3 
      Caption         =   "="
      BeginProperty Font 
         Name            =   "微軟正黑體"
         Size            =   20.25
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   4080
      TabIndex        =   5
      Top             =   480
      Width           =   495
   End
   Begin VB.Label Label2 
      Caption         =   "??"
      BeginProperty Font 
         Name            =   "微軟正黑體"
         Size            =   18
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1215
      Left            =   4560
      TabIndex        =   3
      Top             =   480
      Width           =   1455
   End
   Begin VB.Label Label1 
      Caption         =   "+"
      BeginProperty Font 
         Name            =   "微軟正黑體"
         Size            =   26.25
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   1920
      TabIndex        =   1
      Top             =   360
      Width           =   735
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    '小貓貓世界第一，無庸置疑
    'by 忽悠的小紮子 2/26
    a = Val(Text1.Text)
    b = Val(Text2.Text)
    
    x = Label1.Caption
    If x = "+" Then c = a + b
    If x = "-" Then c = a - b
    If x = "*" Then c = a * b
    
    '避免除數為零，提前作條件限制(指令順序由上而下)
    'if / else / end if
    If x = "/" Then
        If b = 0 Then
            c = "除數不能為零的說"
        Else
            c = a / b
        End If
    End If
    Label2.Caption = c

End Sub

Private Sub Command2_Click()
    x = Label1.Caption
    If x = "+" Then Label1.Caption = "-"
    If x = "-" Then Label1.Caption = "*"
    If x = "*" Then Label1.Caption = "/"
    If x = "/" Then Label1.Caption = "+"

End Sub

Private Sub Label1_Click()
    Call Command2_Click

End Sub

Private Sub Label3_Click()
    Call Command1_Click
End Sub
