СообЧа > База Знаний > Программирование > Visual Basic > Формы и элементы управления

Вопрос

Как сделать, чтоб можно было изменять размеры какого-нибудь эу? Примерно так, как изменяются размеры обычной формы.

Ответ

Option Explicit
Dim bool As Boolean

Private Sub Form_Load()
bool = False
Picture1.ScaleMode = vbPixels
Picture3.ScaleMode = vbPixels
Picture1.MousePointer = 7
Picture3.MousePointer = 9
Picture1.Move 0, 3000, 3000, 60
Picture3.Move 3000, 0, 60, 3000
Picture2.Move 0, 0, 3000, 3000
End Sub
Private Sub Picture3_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
bool = True
Dim xx As Long
Dim yy As Long
Picture3.BackColor = vbWhite
For xx = 0 To Picture3.Width / Screen.TwipsPerPixelX Step 2
For yy = 0 To Picture3.Height / Screen.TwipsPerPixelY
Picture3.PSet (xx + Int((-0.5) ^ yy), yy)
Next yy
Next xx
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
bool = True
Dim xx As Long
Dim yy As Long
Picture1.BackColor = vbWhite
For xx = 0 To Picture1.Width / Screen.TwipsPerPixelX Step 2
For yy = 0 To Picture1.Height / Screen.TwipsPerPixelY
Picture1.PSet (xx + Int((-0.5) ^ yy), yy)
Next yy
Next xx
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If bool = True Then
Picture1.Top = Picture1.Top + Y
Picture2.Move 0, 0, Picture2.Width, Picture1.Top
Picture3.Height = Picture1.Top
End If
End Sub
Private Sub Picture3_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If bool = True Then
Picture3.Left = Picture3.Left + X
Picture2.Move 0, 0, Picture3.Left, Picture2.Height
Picture1.Width = Picture3.Left
End If
End Sub
Private Sub Picture3_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
bool = False
Picture3.BackColor = Me.BackColor
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
bool = False
Picture1.BackColor = Me.BackColor
End Sub

shadow



Copyright © 2000-2004 Сообщество Чайников
Контактная информация