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 表示要打开的文件名,文件名可以包含有驱动器和目 ......
VB下如何编写CRC校验程序
随着计算机技术的不断发展,在现代工业中,利用微机进行数据通讯的工业控制应用得也越来越广泛。由于传输距离、现场状况等诸多可能出现的因素影响,计算机与受控设备之间的通讯数据常会发生无法预测的错误。为了防止错误所带来的影响,一般在通讯时采取数据校验的办法,而循环冗余码校 ......
http://topic.csdn.net/t/20030306/11/1497896.html#
工程文件名:Chdsp.vbp
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\PWIN95\SYSTEM\\STDOLE2.TLB#OLE Automation
Module=Module1; ChDsp.bas
Form=ChDsp.frm
Startup="Form1"
He ......
——————————————————————————————————
在c#中如何使用以前c++的.lib库和.h头文件
zhujiang_1977(朱江 ......
工作需要,针对java文件,作了一个行数统计的工具。统计的主要代码如下:
Set srcIn = fso.OpenTextFile(fileNm, ForReading)
Do While Not srcIn.AtEndOfStream
buf = srcIn.ReadLine
&nbs ......