Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

VBʵÏÖÈ«´°ÌåÒƶ¯

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 Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
ReleaseCapture
SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
End If
End Sub
http://topic.csdn.net/t/20030524/18/1829023.html
http://zhidao.baidu.com/question/93411647.html?fr=qrl&cid=867&index=5&fr2=query
ÎÒÏë°Ñform5Òƶ¯µ½form3ÖÐpicture1µÄλÖã¬ÏÂÃæÊÇÎҵĴúÂ루ÔÚform3µÄcodeÖУ©£º
Dim r2 As RECT
GetWindowRect Picture1.hwnd, r2
Form5.ScaleMode = vbPixels 'ÉèÖÃ×ø±êµ¥Î»ÎªÏñËØ
Form5.Move r2.Left, r2.Top
Form5.Show
ΪʲôÒƶ¯µÄ×ø±êÈÔÈ»ÊÇĬÈϵÄ羶ø²»ÊÇÆÁÄ»ÏñËØÄØ£¿
ÇëÖ¸½Ì£¡
ÎÊÌâ²¹³ä£º
ҪʵÏÖ´°¿ÚµÄÕýÈ·Òƶ¯£¬Ó¦¸ÃÔõô×ö£¿
½«form5µÄ×óÉϽǵÄλÖÃŲµ½form3ÖÐpicture1×óÉϽǵÄλÖÃ
 'form3ÖÐ
Private Type rect
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As rect) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Sub Command1_Click()
Dim wrect As rect
Dim picrect As rect
GetWindowRect Picture1.hwnd, picrect
GetWindowRect Form5.hwnd, wrect
MoveWindow Form5.hwnd, picrect.Left, picrect.Top, wrect.Right - wrect.Left, wrect.Bottom - wrect.Top, True
Form5.Show
End Sub


Ïà¹ØÎĵµ£º

VBÓëFTP±à³Ì

Option Explicit
Private Const INTERNET_OPEN_TYPE_DIRECT = 1
Private Const scuseragent = "vb wininet"
Private Const INTERNET_FLAG_PASSIVE = &H8000000
'µ÷ÓÃÉèÖû·¾³
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long ......

VBÁù¸öÊýÈ¡×î´óÖµºÍ×îСÊý

mxl=1                          && ×î´óµÄÎı¾¿ò±àºÅ
mnl=1                  &n ......

VB»ñÈ¡Íø¿¨MACµØÖ·´úÂë

Option Explicit
Private Const NCBASTAT = &H33
Private Const NCBNAMSZ = 16
Private Const HEAP_ZERO_MEMORY = &H8
Private Const HEAP_GENERATE_EXCEPTIONS = &H4
Private Const NCBRESET = &H32
Private Type NCB
ncb_command As Byte
ncb_retcode As Byte
ncb_lsn As Byte
ncb_num As Byte ......

vb ´®¿ÚͨѶ

MSComm¿Ø¼þÌṩÁËÁ½ÖÖ´¦ÀíͨÐŵķ½Ê½£ºÒ»ÖÖΪʼþÇý¶¯·½Ê½£¬¸Ã·½Ê½Ï൱ÓÚÒ»°ã³ÌÐòÉè¼ÆÖеÄÖжϷ½Ê½¡£µ±´®¿Ú·¢Éúʼþ»ò´íÎóʱ£¬MSComm¿Ø¼þ»á²úÉúOnCommʼþ£¬Óû§³ÌÐò¿ÉÒÔ²¶»ñ¸Ãʼþ½øÐÐÏàÓ¦´¦Àí¡£±¾ÎĵÄÁ½¸öÀý×Ó¾ù²ÉÓø÷½Ê½¡£ÁíÒ»ÖÖΪ²éѯ·½Ê½£¬ÔÚÓû§³ÌÐòÖÐÉè¼Æ¶¨Ê±»ò²»¶¨Ê±²éѯ MSComm¿Ø¼þµÄijЩÊôÐÔÊÇ·ñ·¢Éú±ä»¯£¬´Ó¶øÈ ......

VBÔõÑùÅжϡ¢·ÀÖ¹³ÌÐòÖظ´Ö´ÐÐ

Private Sub Form_load()
    'ÅжϳÌÐòÊÇ·ñÒѾ­ÔËÐÐ
    If App.PrevInstance
Then
     MsgBox "±¾³ÌÐòÒѾ­ÔËÐУ¡", vbInformation Or vbOKOnly, "ÌáʾÐÅÏ¢"
     Unload
Me
     Exit Sub
&n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ