VERSION 5.00
Begin VB.Form frm1 
   BackColor       =   &H00004040&
   Caption         =   "Треугольник"
   ClientHeight    =   4365
   ClientLeft      =   2880
   ClientTop       =   2490
   ClientWidth     =   6600
   LinkTopic       =   "Form1"
   PaletteMode     =   2  'Custom
   ScaleHeight     =   4365
   ScaleWidth      =   6600
   Begin VB.TextBox txtY 
      Height          =   375
      Left            =   4320
      TabIndex        =   10
      Top             =   3120
      Width           =   495
   End
   Begin VB.TextBox txtX 
      Height          =   375
      Left            =   120
      TabIndex        =   9
      Top             =   120
      Width           =   495
   End
   Begin VB.PictureBox picPaint 
      BackColor       =   &H00FFFFFF&
      DrawWidth       =   2
      Height          =   3405
      Left            =   720
      ScaleHeight     =   3345
      ScaleMode       =   0  'User
      ScaleWidth      =   3069.768
      TabIndex        =   0
      Top             =   120
      Width           =   3525
   End
   Begin VB.Label lblPer 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      Caption         =   "Периметр"
      Height          =   375
      Left            =   3360
      TabIndex        =   18
      Top             =   3840
      Width           =   1215
   End
   Begin VB.Label lblSq 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      Caption         =   "Площадь"
      Height          =   375
      Left            =   240
      TabIndex        =   17
      Top             =   3840
      Width           =   1215
   End
   Begin VB.Label lblPerRez 
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   4680
      TabIndex        =   16
      Top             =   3840
      Width           =   1575
   End
   Begin VB.Label lblSqRez 
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   1560
      TabIndex        =   15
      Top             =   3840
      Width           =   1575
   End
   Begin VB.Label lblY3 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      Caption         =   "Y3"
      Height          =   375
      Left            =   5040
      TabIndex        =   14
      Top             =   2760
      Width           =   255
   End
   Begin VB.Label lblX3 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      Caption         =   "X3"
      Height          =   375
      Left            =   5040
      TabIndex        =   13
      Top             =   2280
      Width           =   255
   End
   Begin VB.Label lblY3Rez 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   5400
      TabIndex        =   12
      Top             =   2760
      Width           =   975
   End
   Begin VB.Label lblX3Rez 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   5400
      TabIndex        =   11
      Top             =   2280
      Width           =   975
   End
   Begin VB.Label lblY2ReZ 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   5400
      TabIndex        =   8
      Top             =   1680
      Width           =   975
   End
   Begin VB.Label lblX2Rez 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   5400
      TabIndex        =   7
      Top             =   1200
      Width           =   975
   End
   Begin VB.Label lblY1Rez 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   5400
      TabIndex        =   6
      Top             =   600
      Width           =   975
   End
   Begin VB.Label lblX1Rez 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   5400
      TabIndex        =   5
      Top             =   120
      Width           =   975
   End
   Begin VB.Label lblY2 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      Caption         =   "Y2"
      Height          =   375
      Left            =   5040
      TabIndex        =   4
      Top             =   1680
      Width           =   255
   End
   Begin VB.Label lblX2 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      Caption         =   "X2"
      Height          =   375
      Left            =   5040
      TabIndex        =   3
      Top             =   1200
      Width           =   255
   End
   Begin VB.Label lblY1 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      Caption         =   "Y1"
      Height          =   375
      Left            =   5040
      TabIndex        =   2
      Top             =   600
      Width           =   255
   End
   Begin VB.Label lblX1 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFC0&
      Caption         =   "X1"
      Height          =   375
      Left            =   5040
      TabIndex        =   1
      Top             =   120
      Width           =   255
   End
   Begin VB.Menu mnuScale 
      Caption         =   "Масштаб"
      Begin VB.Menu mnu100 
         Caption         =   "100*100"
      End
      Begin VB.Menu mnu1000 
         Caption         =   "1000*1000"
      End
   End
   Begin VB.Menu mnuTr 
      Caption         =   "Треугольник"
      Begin VB.Menu mnuTrDraw 
         Caption         =   "Построить"
      End
      Begin VB.Menu mnuTrPer 
         Caption         =   "Периметр"
      End
      Begin VB.Menu mnuTrSq 
         Caption         =   "Площадь"
      End
   End
   Begin VB.Menu mnuEdit 
      Caption         =   "Правка"
      Begin VB.Menu mnuClear 
         Caption         =   "Очистить"
      End
   End
End
Attribute VB_Name = "frm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public sngX1, sngX2, sngY1, sngY2, sngX3, sngY3, sngX, sngY, sngL1, sngL2, sngL3, sngPer As Single

Private Sub picPaint_MouseDown(Button As Integer, Shift As Integer, sngX As Single, sngY As Single)
Select Case Shift
Case Is = 1
sngX1 = sngX: sngY1 = sngY: lblX1Rez = sngX1: lblY1Rez = sngY1
Case Is = 2
sngX2 = sngX: sngY2 = sngY: lblX2Rez = sngX2: lblY2ReZ = sngY2
Case Is = 4
sngX3 = sngX: sngY3 = sngY: lblX3Rez = sngX3: lblY3Rez = sngY3
End Select
End Sub
Private Sub mnu100_Click()
picPaint.Scale (0, 100)-(100, 0)
txtX = 100
txtY = 100
End Sub
Private Sub mnu1000_Click()
picPaint.Scale (0, 1000)-(1000, 0)
txtX = 1000
txtY = 1000
End Sub
Private Sub mnuClear_Click()
picPaint.Cls
End Sub
Private Sub mnuTrDraw_Click()
picPaint.Line (sngX1, sngY1)-(sngX2, sngY2)
picPaint.Line (sngX1, sngY1)-(sngX3, sngY3)
picPaint.Line (sngX2, sngY2)-(sngX3, sngY3)
End Sub
Private Sub mnuTrPer_Click()
sngL1 = Sqr((sngX2 - sngX1) ^ 2 + (sngY2 - sngY1) ^ 2)
sngL2 = Sqr((sngX3 - sngX1) ^ 2 + (sngY3 - sngY1) ^ 2)
sngL3 = Sqr((sngX2 - sngX3) ^ 2 + (sngY2 - sngY3) ^ 2)
sngPer = sngL1 + sngL2 + sngL3
lblPerRez = sngPer
End Sub
Private Sub mnuTrSq_Click()
lblSqRez = Sqr(sngPer * (sngPer - sngL1) * (sngPer - sngL2) * (sngPer - sngL3))
End Sub
