Finns det nån kod så att man fortfarande kan ändra storlek på ett fönster även fast man har Border = None? Prova denna kod.Ändra storlek utan border
ThomasSv: Ändra storlek utan border
Öppna ett tomt formulär
Placera ut en picturebox men namn picturebox1
Bordersyle=0
Klistra in denna kod
Option Explicit
'DefLng A-Z
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private m_rcSizeGrip As RECT
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTBOTTOMRIGHT = 17
'Private Const DFC_SCROLL = 3
'Private Const DFCS_SCROLLSIZEGRIP = &H8
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function InvalidateRect Lib "user32" (ByVal hWnd As Long, lpRect As Any, ByVal bErase As Long) As Long
Private Sub Form_Resize()
If Me.WindowState = vbMinimized Then Exit Sub
With m_rcSizeGrip
.Bottom = Me.ScaleHeight
.Right = Me.ScaleWidth
.Left = .Right - 15
.Top = .Bottom - 15
End With
Picture1.Left = form1.ScaleWidth - Picture1.Width
Picture1.Top = form1.ScaleHeight - Picture1.Height
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call ReleaseCapture
Call SendMessage(Me.hWnd, WM_NCLBUTTONDOWN, HTBOTTOMRIGHT, ByVal 0&)
InvalidateRect Me.hWnd, ByVal 0&, 1 '// causes the form to repaint
'Call Form_Resize '// recalc the rect
End Sub
MVH
johan