資源描述:
《vb常用代碼總結(jié).doc》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、VB常用代碼總結(jié)原文出自木螞蟻社區(qū)www.mumayi.net,本貼地址:http://bbs.mumayi.net/viewthread.php?tid=809605移動(dòng)無標(biāo)題欄的窗體(borderstyle=none)dimmouseXasintegerdimmouseYasintegerdimmoveXasintegerdimmoveYasintegerdimdownasbooleanform_mousedown:'mousedown事件down=truemouseX=xmouseY=yform_mouseup:'mouseup事件down=fals
2、eform_mousemoveifdown=truethen??moveX=me.left-mouseX+X??moveY=me.top-mouseY+Y??me.movemoveX,moveYendif***********************************************************************閃爍控件比如要閃爍一個(gè)label(標(biāo)簽)添加一個(gè)時(shí)鐘控件間隔請(qǐng)根據(jù)實(shí)際需要設(shè)置enabled屬性設(shè)為true代碼為:label1.visible=notlabel1.visible******************
3、****************************************************禁止使用Alt+F4關(guān)閉窗口PrivateDeclareFunctionDeleteMenuLib"user32"(ByValhMenuAsLong,ByValnPositionAsLong,ByValwFlagsAsLong)AsLongPrivateDeclareFunctionGetMenuItemCountLib"user32"(ByValhMenuAsLong)AsLongPrivateConstMF_BYPOSITION=&H400&Priv
4、ateSubForm_Load()DimhwndMenuAsLongDimcAsLonghwndMenu=GetSystemMenu(Me.hwnd,0)c=GetMenuItemCount(hwndMenu)DeleteMenuhwndMenu,c-1,MF_BYPOSITIONc=GetMenuItemCount(hwndMenu)DeleteMenuhwndMenu,c-1,MF_BYPOSITIONEndSub**********************************************************************
5、*啟動(dòng)控制面板大全'打開控制面板CallShell("rundll32.exeshell32.dll,Control_RunDLL",9)'輔助選項(xiàng)屬性-鍵盤CallShell("rundll32.exeshell32.dll,Control_RunDLLaccess.cpl,,1",9)'輔助選項(xiàng)屬性-聲音CallShell("rundll32.exeshell32.dll,Control_RunDLLaccess.cpl,,2",9)'輔助選項(xiàng)屬性-顯示CallShell("rundll32.exeshell32.dll,Control_RunDLLa
6、ccess.cpl,,3",9)'輔助選項(xiàng)屬性-鼠標(biāo)CallShell("rundll32.exeshell32.dll,Control_RunDLLaccess.cpl,,4",9)'輔助選項(xiàng)屬性-常規(guī)CallShell("rundll32.exeshell32.dll,Control_RunDLLaccess.cpl,,5",9)'添加/刪除程序?qū)傩?安裝/卸載CallShell("rundll32.exeshell32.dll,Control_RunDLLAppwiz.cpl,,1",9)'添加/刪除程序?qū)傩?Windows安裝程序CallShell
7、("rundll32.exeshell32.dll,Control_RunDLLAppwiz.cpl,,2",9)'添加/刪除程序?qū)傩?啟動(dòng)盤CallShell("rundll32.exeshell32.dll,Control_RunDLLAppwiz.cpl,,3",9)'顯示屬性-背景CallShell("rundll32.exeshell32.dll,Control_RunDLLdesk.cpl,,0",9)'顯示屬性-屏幕保護(hù)程序CallShell("rundll32.exeshell32.dll,Control_RunDLLdesk.cpl,,1
8、",9)'顯示屬性-外觀CallShell("rundll32.e