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 表示要打开的文件名,文件名可以包含有驱动器和目 ......
Option Explicit
Public Function ascii2Char(strInput As String) As String
Dim i As Integer
Dim strTemp As String
Dim nPos As Integer
Dim nValue As Integer
i = 1
nPos = InStr(i, strInput, "&#", vbTextCompare)
While (nPos > 0)
ascii2Char = ascii2Char + Left(st ......
正在开发小秘书系统并不断提高其智能水平,其中用到的是脚本支持的技术
虽然这部分不属于初学者使用,然而有些人想学这个东东,这里就发~~~布出去吧!
新建一个标准exe工程(Standard EXE);
"工程"(Project)-->"部件"(Components)
选定"Microsoft Script Control 1.0" ,位置是C:\WINDOWS\system32\msscript.ocx
添 ......
VB 字符串处理函数集
收藏
mid(字符串,从第几个开始,长度)
在[字符串]中[从第几个开始]取出[长度个字符串]
例如 mid("小欣无敌",1,3) 则返回 "小欣无"
instr(从第几个开始,字符串1,字符串2)
从规定的位置开始查找 ......
http://blog.donews.com/sloo/archive/2006/01/29/711269.aspx
1.用Microsoft Internet Transfer Control 控件(在部件中添加),代码非常简单,如下(在form上添加一个Inet1和Text1和Command1):
Private Sub Command1_Click()
Text1.Text = Inet1.OpenURL("http://www.vbgood.com/")
End Sub
2.如果是使用 W ......