Thiếtkếmộtmáytínhđơngiản Dim so1, so2, kq, pt Private Sub cmdAC_Click() mh.Text = "" End Sub Private Sub cmdchia_Click() so1 = Val(mh.Text) pt = "/" mh.Text = "" End Sub Private Sub cmdcong_Click() so1 = Val(mh.Text) pt = "+" mh.Text = "" End Sub Private Sub cmdenter_Click() so2 = Val(mh.Text) Select Case pt Case "+" kq = so1 + so2 mh.Text = Str(kq) Case "-" kq = so1 - so2 mh.Text = Str(kq) Case "*" kq = so1 * so2 mh.Text = Str(kq) Case "/" If so2 <> 0 Then kq = so1 / so2 mh.Text = Str(kq) Else MsgBox "Khong chia duoc" mh.Text = "" End If End Select so1 = Val(mh.Text) End Sub Private Sub cmdnhan_Click() so1 = Val(mh.Text) pt = "*" mh.Text = "" End Sub Private Sub cmdso_Click(Index As Integer) mh.Text = RTrim(mh.Text) & LTrim(Str(Index)) End Sub Private Sub cmdtru_Click() so1 = Val(mh.Text) pt = "-" mh.Text = "" End Sub Private Sub Form_Load() mh.Text = "" End Sub . Thiết kế một máy tính đơn giản Dim so1, so2, kq, pt Private Sub cmdAC_Click() mh.Text = ""