vb里面的from属性

来源:百度知道 编辑:UC知道 时间:2024/05/16 02:24:15
把borderstyle改为0-none后
就是不要边框.
生成的应用程序窗体用鼠标拖不动.要怎么办呢?

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 SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2
' 以上API函数和常数的声明可在VB自带的“API浏览器”中找到
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'在窗体的MouseDown事件中添加以下代码
If Button = 1 Then
Call ReleaseCapture '释放鼠标控件权
Call SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
'发送一个鼠标在标题栏上的消息HTCAPTION,Windows结果被欺骗了,于是就执行窗体移动操作
End If
End Sub
希望对你有所帮助.