ReMLe skrev:
> Ja, men jeg vil selv lave sådanne en!!!
> altså formen "BorderStyle" står til "none"
Så er det nok noget i retningen af dette her kode, du har brug for (der kan
godt laves mange forbedringer - f.eks. "blinker" formen rimeligt meget).
.... jeg kan dog desværre ikke hjælpe dig mere lige nu - jeg tager nemlig på
ferie!
- Bjarke Walling Petersen
' *** Kode til at lave resizeable form UDEN BorderStyle=Resizeable ***
'
Const BorderSize = 45 'Størrelsen på den kant, hvor man
Dim ResizeValue As Integer 'kan aktivere resize...
Dim XPos As Single
Dim YPos As Single
Private Sub Form_Load()
ResizeValue = 0
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)
ResizeValue = 0
If Button = 1 Then
If X < BorderSize Then
ResizeValue = ResizeValue + 1
End If
If Me.Width - 15 - X < BorderSize Then
ResizeValue = ResizeValue + 2
End If
If Y < BorderSize Then
ResizeValue = ResizeValue + 4
End If
If Me.Height - 15 - Y < BorderSize Then
ResizeValue = ResizeValue + 8
End If
XPos = X
YPos = Y
End If
Select Case ResizeValue
Case 6, 9
Me.MousePointer = 6
Case 4, 8
Me.MousePointer = 7
Case 5, 10
Me.MousePointer = 8
Case 1, 2
Me.MousePointer = 9
Case Else
Me.MousePointer = 0
End Select
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single,
Y As Single)
If ResizeValue And 1 Then
Me.Left = Me.Left - (XPos - X)
Me.Width = Me.Width + (XPos - X)
End If
If ResizeValue And 2 Then
Me.Width = Me.Width - (XPos - X)
XPos = X
End If
If ResizeValue And 4 Then
Me.Top = Me.Top - (YPos - Y)
Me.Height = Me.Height + (YPos - Y)
End If
If ResizeValue And 8 Then
Me.Height = Me.Height - (YPos - Y)
YPos = Y
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y
As Single)
ResizeValue = 0
Me.MousePointer = 0
End Sub