VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4860
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6945
   LinkTopic       =   "Form1"
   ScaleHeight     =   4860
   ScaleWidth      =   6945
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text3 
      Height          =   615
      Left            =   3960
      TabIndex        =   4
      Text            =   "Text3"
      Top             =   720
      Width           =   2055
   End
   Begin VB.TextBox Text2 
      Height          =   615
      Left            =   360
      TabIndex        =   3
      Text            =   "Text2"
      Top             =   1200
      Width           =   2295
   End
   Begin VB.TextBox Text1 
      Height          =   615
      Left            =   360
      TabIndex        =   2
      Text            =   "Text1"
      Top             =   240
      Width           =   2295
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Кнопка2"
      Height          =   495
      Left            =   3840
      TabIndex        =   1
      Top             =   4200
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Кнопка1"
      Height          =   495
      Left            =   5520
      TabIndex        =   0
      Top             =   4200
      Width           =   1215
   End
   Begin VB.Label Label3 
      Caption         =   " окно3"
      Height          =   615
      Left            =   6120
      TabIndex        =   7
      Top             =   720
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "окно2"
      Height          =   495
      Left            =   2880
      TabIndex        =   6
      Top             =   1200
      Width           =   615
   End
   Begin VB.Label Label1 
      Caption         =   " окно1"
      Height          =   495
      Left            =   2880
      TabIndex        =   5
      Top             =   360
      Width           =   615
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Инициализация
Option Explicit
Dim vntA, vntB, vntR
Dim prompt As String
Dim title As String

Private Sub Command1_Click()
Text1.Visible = False
Text2.Visible = False
Text3.Visible = False
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False

Do While True
'Ввод первого слагаемого
  Do While True
     prompt = "Первое слагаемое"
     title = "Суммирование"
     vntA = InputBox(prompt, title)
     If vntA = "" Then Exit Sub
     'Проверка на правильность ввода
     If IsNumeric(vntA) Then
     Exit Do
     Else
     Call showerror
     End If
  Loop
     'Ввод второго слагаемого
  Do While True
     prompt = "Второе слагаемое"
     title = "Суммирование"
     vntB = InputBox(prompt, title)
     If vntB = "" Then Exit Sub
     'Проверка на правильность ввода
     If IsNumeric(vntB) Then
     Exit Do
     Else
     Call showerror
     End If
  Loop
  vntR = CDbl(vntA) + CDbl(vntB)
'Выведение сообщения о результате
   prompt = "Результат" & vntR
   prompt = prompt & Chr(13) & Chr(10)
   prompt = prompt & "Продолжить?"
   title = "Суммирование"
   vntR = MsgBox(prompt, vbYesNo, title)
  If vntR = vbNo Then Exit Do
Loop

End Sub

Private Sub Command2_Click()
Text1.Visible = True
Text2.Visible = True
Text3.Visible = True

End Sub

Private Sub Form_Click()
End
End Sub

Private Sub showerror()
  prompt = "Повторите ввод"
  title = "Ошибка"
  vntR = MsgBox(prompt, vbCritical, title)

End Sub

Private Sub Form_Load()
Text1.Visible = False
Text2.Visible = False
Text3.Visible = False
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False

End Sub
