vb移动窗体的代码
Option Explicit
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 Long) As Long
Const HTCAPTION = 2
Const WM_NCLBUTTONDOWN = &HA1
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
If Button = 1 Then ' Checking for Left Button only
Dim ReturnVal As Long
x = ReleaseCapture()
ReturnVal = SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
mX = X: mY = Y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
Me.Move Me.Left - mX + X, Me.Top - mY + Y
End If
End Sub
相关文档:
vb使用open方法读写文件
(一)打开和关闭文件
1、顺序文件
打开顺序文件,我们可以使用Open语句。它的格式如下:
Open pathname For [Input |Output |Append] As [#]filenumber [Len = buffersize]
说明:
(1)参数pathname 表示要打开的文件名,文件名可以包含有驱动器和目 ......
http://www.Experts-Exchange.com: 非常好的问题 讨论区,高手数不尽,而且这里的人很有专业精神,不会讨论一些和程序无关又无聊的问题。不过想要别人帮你 解决问题,自己也要有真诚的态度。
http://www.Codeguru.com/vb: 有名的源码讨论站 点,特点是在每个源码下面都可以跟帖讨论。
http://www.planet-source-code.co ......
'引用:Microfoft VBScript Regular Expressions 5.5 '一个正则提取功能
Public Function regGetStr_three(ByVal myString As String, ByVal patReg As String) As String()
Dim objRegExp As RegExp
Dim objMatch As Match
Dim colMatches As Ma ......
——————————————————————————————————
在c#中如何使用以前c++的.lib库和.h头文件
zhujiang_1977(朱江 ......
转自:http://hi.baidu.com/sunward08/blog/item/cb64ac224657014dac34de2d.html
WinForm使用WebService自动升级
2009-08-08 10:49
winform程序相对web程序而言,功能更强大,编程更方便,但软件更新却相当麻烦,要到客户端一台一台地升级,面对这个实际问题,在最近的一个小项目中,本人设计了一个通过软 ......