'в General Declaration {
Dim startX As Single, _
startY As Single
'}
'в Любом месте из предыдущего аттачмента {
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
DrawStyle = DrawStyleConstants.vbDot
startX = X
startY = Y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Cls
Line (startX, startY)-(X, Y), , B
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim CX As Single, CY As Single
If Button = vbLeftButton Then
For Each Pict In Picture1
CX = Pict.Left + Pict.Width / 2 'вычисляем соординаты центра
CY = Pict.Top + Pict.Height / 2
Pict.Tag = _
((CX >= startX And CX <= X) Or _
(CX <= startX And CX >= X)) And _
((CY >= startY And CY <= Y) Or _
(CY <= startY And CY >= Y))
Next
DrawStyle = DrawStyleConstants.vbSolid
Cls
RedrawSelect
End If
End Sub
'}
Сейчас этот форум просматривают: Google-бот, SemrushBot и гости: 63