资源描述:
《vb常用代码大全》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、VB常用代码移动无标题栏的窗体dim m(borderstyle=none)ouseX as integerdim mouseY as integerdim moveX as integerdim moveY as integerdim down as booleanform_mousedown: 'mousedown事件down=truemouseX=xmouseY=yform_mouseup: 'mouseup事件down=falseform_mousemoveif down=true then moveX=me.left-mouseX+X
2、 moveY=me.top-mouseY+Y me.move moveX,moveYend if*******************************************闪烁控件比如要闪烁一个label(标签)添加一个时钟控件 间隔请根据实际需要设置 enabled属性设为true代码为:label1.visible=not label1.visible*******************************************禁止使用 Alt+F4 关闭窗口 Private Declare Function Delete
3、Menu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As LongPrivate Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As LongPrivate Const MF_BYPOSITION = &H400& Private Sub Form_Load()Dim hwndMenu As LongDim c As LonghwndMen
4、u = GetSystemMenu(Me.hwnd, 0)c = GetMenuItemCount(hwndMenu)DeleteMenu hwndMenu, c - 1, MF_BYPOSITIONc = GetMenuItemCount(hwndMenu)DeleteMenu hwndMenu, c - 1, MF_BYPOSITIONEnd Sub启动控制面板大全-16-'打开控制面板Call Shell("rundll32.exe shell32.dll,Control_RunDLL", 9)'辅助选项 属性-键盘Call Shell("ru
5、ndll32.exe shell32.dll,Control_RunDLL access.cpl,,1", 9)'辅助选项 属性-声音Call Shell("rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2", 9)'辅助选项 属性-显示Call Shell("rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3", 9)'辅助选项 属性-鼠标Call Shell("rundll32.exe shell32.dll,Control_RunD
6、LL access.cpl,,4", 9)'辅助选项 属性-常规Call Shell("rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5", 9)'添加/删除程序 属性-安装/卸载Call Shell("rundll32.exe shell32.dll,Control_RunDLL Appwiz.cpl,,1", 9)'添加/删除程序 属性-Windows安装程序Call Shell("rundll32.exe shell32.dll,Control_RunDLL Appwiz.cpl,,2"
7、, 9)'添加/删除程序 属性-启动盘Call Shell("rundll32.exe shell32.dll,Control_RunDLL Appwiz.cpl,,3", 9)'显示 属性-背景Call Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0", 9)'显示 属性-屏幕保护程序Call Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1", 9)'显示 属性-外观Call Shell("rundll32.e
8、xe shell32.dll,Control_RunDLL desk.cpl,,2", 9)'显示 属性-设