Oppure

Loading
03/12/16 10:25
piter123
Salve,
avrei bisogno di intercettare l'evento del doppio click sulla barra/titolo di una form in modo
che non venga ridimensionata a tutto schermo ma che possa essere ridimensionate con
dei valori personalizzati.

Grazie
aaa
03/12/16 14:36
piter123
rispondo io cercando in giro :

Public Class Form1
Private Const WM_NCLBUTTONDOWN As Long = &HA1
Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
Private Const MOUSEEVENTF_MIDDLEUP = &H40
Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, _
ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo _
As Integer)

Protected Overrides Sub DefWndProc(ByRef m As System.Windows.Forms.Message)
If CLng(m.Msg) = WM_NCLBUTTONDOWN Then
mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 1)
mouse_event(MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 1)
End If
MyBase.DefWndProc(m)
End Sub
End Class
aaa