无边框窗体拖动大小代码
2009-04-07 16:47
295 查看
无边框窗体拖动大小代码
VB.NET Code
VB.NET Code
Const WM_NCHITTEST As Integer = &H84 Const HTLEFT As Integer = 10 Const HTRIGHT As Integer = 11 Const HTTOP As Integer = 12 Const HTTOPLEFT As Integer = 13 Const HTTOPRIGHT As Integer = 14 Const HTBOTTOM As Integer = 15 Const HTBOTTOMLEFT As Integer = &H10 Const HTBOTTOMRIGHT As Integer = 17 Protected Overloads Overrides Sub WndProc(ByRef m As Message) MyBase.WndProc(m) Select Case m.Msg Case WM_NCHITTEST Dim vPoint As New Point(CInt(m.LParam) And &HFFFF, CInt(m.LParam) >> 16 And &HFFFF) vPoint = PointToClient(vPoint) If vPoint.X <= 5 Then If vPoint.Y <= 5 Then m.Result = CType(HTTOPLEFT, IntPtr) ElseIf vPoint.Y >= ClientSize.Height - 5 Then m.Result = CType(HTBOTTOMLEFT, IntPtr) Else m.Result = CType(HTLEFT, IntPtr) End If ElseIf vPoint.X >= ClientSize.Width - 5 Then If vPoint.Y <= 5 Then m.Result = CType(HTTOPRIGHT, IntPtr) ElseIf vPoint.Y >= ClientSize.Height - 5 Then m.Result = CType(HTBOTTOMRIGHT, IntPtr) Else m.Result = CType(HTRIGHT, IntPtr) End If ElseIf vPoint.Y <= 5 Then m.Result = CType(HTTOP, IntPtr) ElseIf vPoint.Y >= ClientSize.Height - 5 Then m.Result = CType(HTBOTTOM, IntPtr) End If Exit Select End Select End Sub
相关文章推荐
- 去掉窗体的边框,并且禁止拖动改变窗体大小
- c++builder如何通过鼠标拖动改变无边框窗体的大小(bsnone)
- 无边框窗体拖动大小
- 无边框窗体拖动和改变大小
- 无边框窗体的拖动以及大小改变的实现方式
- MFC无边框的窗体实现用鼠标拖动窗体边缘实现窗体大小变化
- 实现无边框窗体的拖动及窗体大小变化
- 无边框窗体拖动大小
- MFC无边框的窗体实现用鼠标拖动窗体边缘实现窗体大小变化
- java中 实现无标题无边框的窗体能够用鼠标拖动改变窗口大小
- MFC无边框的窗体实现用鼠标拖动窗体边缘实现窗体大小变化
- MFC无边框的窗体实现用鼠标拖动窗体边缘实现窗体大小变化
- MFC无边框的窗体实现用鼠标拖动窗体边缘实现窗体大小变化
- WPF 去边框 自定义窗体 拖动窗体大小变化
- winform程序中为无边框窗体手动添加窗体拖动代码
- 无边框窗体拖动大小
- MFC 无边框窗体实现用鼠标拖动窗体边缘实现窗体大小变化
- C#无边框窗体实现以及拖动代码
- PB 怎么动态(用代码)改变数据窗口的属性(例如窗体的字体大小,字体颜色,背景颜色)
- C# WinForm 拖动无边框窗体 改变无边框窗体尺寸