VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form КомпьютерВ 
   AutoRedraw      =   -1  'True
   Caption         =   "КомпьютерВ"
   ClientHeight    =   5970
   ClientLeft      =   165
   ClientTop       =   855
   ClientWidth     =   10530
   LinkTopic       =   "Form2"
   ScaleHeight     =   5970
   ScaleWidth      =   10530
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command5 
      Caption         =   "Выход"
      Height          =   495
      Left            =   2760
      TabIndex        =   5
      Top             =   5400
      Width           =   1335
   End
   Begin MSComDlg.CommonDialog Dlg2 
      Left            =   840
      Top             =   5400
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      DialogTitle     =   "Сохранить файл"
      Filter          =   "*.txt"
      Flags           =   2
      FontSize        =   10
      InitDir         =   "C:\Комп\"
      Max             =   16
      Min             =   8
   End
   Begin MSComDlg.CommonDialog Dlg1 
      Left            =   120
      Top             =   5400
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      DialogTitle     =   "Открыть файл"
      FileName        =   "*.*"
      Filter          =   "*.rtf, *.txt"
      Flags           =   2
      FontBold        =   -1  'True
      FontItalic      =   -1  'True
      FontSize        =   10
      FontStrikeThru  =   -1  'True
      FontUnderLine   =   -1  'True
      InitDir         =   "C:\Комп\"
      Max             =   16
      Min             =   8
   End
   Begin RichTextLib.RichTextBox RTxtBox1 
      Bindings        =   "КомпьютерВ.frx":0000
      Height          =   5295
      Left            =   0
      TabIndex        =   4
      Top             =   0
      Width           =   10335
      _ExtentX        =   18230
      _ExtentY        =   9340
      _Version        =   393217
      Enabled         =   -1  'True
      ReadOnly        =   -1  'True
      ScrollBars      =   3
      AutoVerbMenu    =   -1  'True
      TextRTF         =   $"КомпьютерВ.frx":000B
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.CommandButton Command4 
      Caption         =   "Вопрос"
      Height          =   495
      Left            =   6000
      TabIndex        =   3
      Top             =   5400
      Width           =   1455
   End
   Begin VB.CommandButton Command3 
      Caption         =   "№ вопроса"
      Height          =   495
      Left            =   4440
      TabIndex        =   2
      Top             =   5400
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Выкл текст"
      Height          =   495
      Left            =   9120
      TabIndex        =   1
      Top             =   5400
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Сохранить в *.txt"
      Height          =   495
      Left            =   7680
      TabIndex        =   0
      Top             =   5400
      Width           =   1215
   End
   Begin VB.Menu КомпьютерВФ 
      Caption         =   "Файл"
      Index           =   1
      Begin VB.Menu КомпьютерВФО 
         Caption         =   "Открыть..."
         Index           =   11
      End
      Begin VB.Menu КомпьютерВФС 
         Caption         =   "Сохранить в *.rtf"
         Index           =   12
      End
      Begin VB.Menu КомпьютерВФСК 
         Caption         =   "Сохранить как в *.rtf..."
         Index           =   13
      End
   End
   Begin VB.Menu КомпьютерВП 
      Caption         =   "Правка"
      Index           =   3
      Begin VB.Menu КомпьютерВПВ 
         Caption         =   "Вырезать"
         Index           =   31
      End
      Begin VB.Menu КомпьютерВПК 
         Caption         =   "Копировать"
         Index           =   32
      End
      Begin VB.Menu КомпьютерВПВс 
         Caption         =   "Вставить"
         Index           =   33
      End
      Begin VB.Menu КомпьютерВПУ 
         Caption         =   "Удалить"
         Index           =   34
      End
   End
   Begin VB.Menu КомпьютерВ2 
      Caption         =   "Форматирование"
      Index           =   2
      Begin VB.Menu КомпьютерВ2Ш 
         Caption         =   "Шрифт"
         Index           =   21
         Begin VB.Menu КомпьютерВ2Ш1 
            Caption         =   "Весь текст"
            Index           =   211
         End
         Begin VB.Menu КомпьютерВ2Ш2 
            Caption         =   "Выделенный текст"
            Index           =   212
         End
      End
      Begin VB.Menu КомпьютерВ2Ц 
         Caption         =   "Цвет"
         Index           =   22
         Begin VB.Menu КомпьютерВ2Ц1 
            Caption         =   "Выделенный текст"
            Index           =   221
         End
      End
   End
   Begin VB.Menu КомпьютерВ4 
      Caption         =   "Внешние редакторы"
      Index           =   4
      Begin VB.Menu КомпьютерВ41 
         Caption         =   "MSWord"
         Index           =   41
      End
      Begin VB.Menu КомпьютерВ42 
         Caption         =   "Noteped"
         Index           =   42
      End
   End
End
Attribute VB_Name = "КомпьютерВ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim kv(1 To 50) As String, ko(1 To 50) As String, stra, vopr, otv, rfiles, inf As String
Dim i, j, byta, nom, zr As Integer, CancelError As Boolean
Private Sub Command1_Click()
byta = MsgBox("Сохранить файл?", 32 + 3, "Вопрос?")
If byta = 2 Then GoTo 2
On Error GoTo метка
Dlg2.ShowSave
rfiles = Dlg2.FileName
If Right(rfiles, 3) <> "txt" Then
rfiles = rfiles + ".txt"
End If

If byta = 6 Then

 Open rfiles For Output As #1
  For j = 1 To zr
   Print #1, kv(j)
  Next
 Close #1
End If

If byta = 7 Then
 zr = 1
 Open rfiles For Output As #1
  For j = 1 To zr
   Print #1, kv(j)
  Next
 Close #1
 
End If
метка:
2 '
End Sub

Private Sub Command2_Click()
Form1.Command6.Visible = True
RTxtBox1.Visible = False

End Sub

Private Sub Command3_Click()
1 nom = InputBox("Введите № вопроса, <= 50 или i", "Ввод №")
If nom > 50 Then GoTo 1
 i = nom
КомпьютерВ.Print i; kv(nom)

End Sub

Private Sub Command4_Click()
 If Command4.Visible = False Then
   i = i + 1
   zr = i
 End If
stra = InputBox("Введите вопрос", "Ввод вопроса")

If i > 50 Then
 i = 50
 byta = MsgBox("Вопросов > 50", 48 + 0, "")
End If
kv(i) = stra
КомпьютерВ.CurrentX = 120 * i
КомпьютерВ.Print i; kv(i)

End Sub

Private Sub Command5_Click()
КомпьютерВ.Visible = False
End Sub

Private Sub Form_Click()
Form1.Command6.Visible = True
RTxtBox1.Visible = True

End Sub

Private Sub Form_DblClick()
Form1.Command6.Visible = True
КомпьютерВ.Visible = False
End Sub

Private Sub Form_Load()
CancelError = True
Command4.Visible = True
Command3.Visible = True
RTxtBox1.Text = ""
Dlg1.FileName = ""
КомпьютерВ.Cls
читать ' читать файл
End Sub

Private Sub Form_Resize()
Command2.Left = ScaleWidth - 9300
Command1.Left = ScaleWidth - 3300
Command4.Left = ScaleWidth - 5300
Command3.Left = ScaleWidth - 7300
Command5.Left = ScaleWidth - 1500
Command5.Top = ScaleHeight - 700
Command2.Top = ScaleHeight - 700
Command1.Top = ScaleHeight - 700
Command4.Top = ScaleHeight - 700
Command3.Top = ScaleHeight - 700
RTxtBox1.Height = ScaleHeight - 1200
RTxtBox1.Width = ScaleWidth - 200
End Sub

Private Sub КомпьютерВ2Ц1_Click(Index As Integer)
On Error GoTo метка
Dlg1.ShowColor
RTxtBox1.SelColor = Dlg1.Color
КомпьютерВ.ForeColor = Dlg1.Color
Вывод
метка:
End Sub

Private Sub КомпьютерВ2Ш1_Click(Index As Integer)
On Error GoTo метка

Dlg1.ShowFont
RTxtBox1.Font.Size = Dlg1.FontSize
RTxtBox1.Font.Name = Dlg1.FontName
RTxtBox1.Font.Bold = Dlg1.FontBold
RTxtBox1.Font.Italic = Dlg1.FontItalic
RTxtBox1.Font.Underline = Dlg1.FontUnderline
КомпьютерВ.Font.Size = Dlg1.FontSize
КомпьютерВ.Font.Name = Dlg1.FontName
КомпьютерВ.Font.Bold = Dlg1.FontBold
КомпьютерВ.Font.Italic = Dlg1.FontItalic
КомпьютерВ.Font.Underline = Dlg1.FontUnderline
Вывод
метка:
End Sub

Private Sub КомпьютерВ2Ш2_Click(Index As Integer)
On Error GoTo метка

Dlg1.ShowFont
RTxtBox1.SelFontSize = Dlg1.FontSize
RTxtBox1.SelFontName = Dlg1.FontName
RTxtBox1.SelBold = Dlg1.FontBold
RTxtBox1.SelItalic = Dlg1.FontItalic
RTxtBox1.SelUnderline = Dlg1.FontUnderline
метка:
End Sub

Private Sub КомпьютерВ41_Click(Index As Integer)
On Error GoTo метка

Dlg1.FileName = "C:\Program Files\Microsoft Office\Office10\WINWORD.exe"
Interaction.Shell Dlg1.FileName
метка:
End Sub

Private Sub КомпьютерВ42_Click(Index As Integer)
On Error GoTo метка

Dlg1.FileName = "C:\Windows\system32\notepad.exe"
Interaction.Shell Dlg1.FileName
метка:
End Sub

Private Sub КомпьютерВПВ_Click(Index As Integer)
'Очистить буфер обмена
Clipboard.Clear
Clipboard.SetText RTxtBox1.SelText
RTxtBox1.SelText = ""
End Sub

Private Sub КомпьютерВПВс_Click(Index As Integer)
RTxtBox1.SelText = Clipboard.GetText()
End Sub

Private Sub КомпьютерВПК_Click(Index As Integer)
'Очистить буфер обмена
Clipboard.Clear
Clipboard.SetText RTxtBox1.SelText

End Sub

Private Sub КомпьютерВПУ_Click(Index As Integer)
RTxtBox1.SelText = ""

End Sub

Private Sub КомпьютерВФО_Click(Index As Integer)
читать
End Sub

Private Sub КомпьютерВФС_Click(Index As Integer)
On Error GoTo метка

Dlg1.ShowSave
If Dlg1.FileName = "" Then
КомпьютерВФСК1
Else
RTxtBox1.SaveFile Dlg1.FileName
End If
метка:
End Sub

Private Sub КомпьютерВФСК_Click(Index As Integer)
КомпьютерВФСК1
End Sub
Private Sub КомпьютерВФСК1()
On Error GoTo метка

Dlg1.ShowSave
RTxtBox1.SaveFile Dlg1.FileName
метка:
End Sub
Private Sub Вывод()
   КомпьютерВ.Cls
  For j = 1 To zr
   КомпьютерВ.Print j; kv(j)
  Next

End Sub
Private Sub читать()
On Error GoTo метка

11 Dlg1.ShowOpen
If Dlg1.FileName = "*.*" Then GoTo 11

RTxtBox1.LoadFile Dlg1.FileName
If Form1.Option6.Value = True Then
byta = MsgBox("-да- Читать файл , -нет- новый ", 32 + 3, "Вопрос")
  If byta = 2 Then GoTo 3
rfiles = Dlg1.FileName
 If rfiles = "" Or rfiles = "." Then GoTo 3
 If byta = 6 Then
  Open rfiles For Input As #1
  i = 1
   Do Until EOF(1)
   vopr = ""
   Input #1, otv
      kv(i) = otv
      i = i + 1
    Loop
   Close #1
  zr = i - 1
Вывод
End If
  If byta = 7 Then
  i = 0
  Command4.Visible = False
 End If

Else
    КомпьютерВ.CurrentX = 200
    КомпьютерВ.Print " Выберите тест"
    КомпьютерВ.Visible = False
End If
3 '
метка:
End Sub

