Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÓëEXCELµÄÎÞ·ìÁ¬½Ó

 http://social.msdn.microsoft.com/Forums/zh-TW/232/thread/5b0e0eb7-9cd7-420a-9f56-e588154174ba
http://www.mndsoft.com/blog/article.asp?id=903
http://topic.csdn.net/t/20051015/14/4328396.html
¡¡¡¡VBÊdz£ÓõÄÓ¦ÓÃÈí¼þ¿ª·¢¹¤¾ßÖ®Ò»£¬ÓÉÓÚVBµÄ±¨±í¹¦ÄÜÓÐÏÞ£¬¶øÇÒÒ»µ«±¨±í¸ñʽ·¢Éú±ä»¯£¬¾ÍµÃÏàÓ¦Ð޸ijÌÐò£ ......

VB µ¥ÊµÀýÔËÐÐ

VB6
ÔÚ³ÌÐòÔËÐÐʱÓÃÈçÏÂÓï¾ä£º
if   app.PrevInstance=true   then  
            end    
end   if
VB 2005:
1. ÔÚVB2005ÖÐ,´ò¿ª"ÊôÐÔ"Ò³,ÆôÓÃ"Ó¦ÓóÌÐò“¿ò¼Ü, Ñ¡ÖÐ"
µ¥ÊµÀýÓ¦ÓóÌÐò"Ç°Ãæ¸´Ñ¡¿ò,¾ÍÐÐÁË¡£
......

VB ¼òµ¥¼ÆËãÆ÷

Option Explicit
Dim potflag As Integer      '±êʶÊÇ·ñÓÃСÊýµã
Dim numcol As Integer       ' µã»÷ÔËËã·ûµÄ¸öÊý
Dim LastInput               ' ָʾÉÏÒ»´Î²Ù×÷µÄÄÚÈÝ
Dim colflag ......

VB ±à³ÌÖÐÈçºÎʹ´°¿ÚÓÒÉϽǵĹرհ´Å¥(X)ʧЧ

1¡¢Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As
Integer)
        Cancel = True
       End Sub
    2¡¢Private Sub
Form_Unload(Cancel As Integer)
        Cancel = ......

VBÉèÖýø³ÌÓÅÏȼ¶

http://topic.csdn.net/t/20060401/19/4656391.html
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function SetPriorityClass Lib "kernel32" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long
Const IDLE_PRIORITY_CLASS = &H40 'нø³ÌÓ¦¸ÃÓзdz£µÍµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ