Imports System Drawing Imports System Windows Forms 裂搭手 ****************************************** Private oOriginalRegion As Region = Nothing 用于窗体移动 Private bFormDragging As Boolean = False Private oPointClicked As Point ****************************************** Private Sub Form _MouseDown(ByVal sender As Object ByVal e As System Windows Forms MouseEventArgs) Handles MyBase MouseDown Me bFormDragging = True Me oPointClicked = New Point(e X e Y) End Sub ****************************************** Private Sub Form _MouseUp(ByVal sender As Object ByVal e As System Windows Forms MouseEventArgs) Handles MyBase MouseUp Me bFormDragging = False End Sub ****************************************** Private Sub Form _MouseMove(ByVal sender As Object ByVal e As System Windows Forms MouseEventArgs) Handles MyBase MouseMove If Me bFormDragging Then Dim oMoveToPoint As Point 以当前鼠标肆嫌位置为基础 找出目标位置 oMoveToPoint = Me PointToScreen(New Point(e X e Y)) 枝兄 根据开始位置作出调整 oMoveToPoint Offset(Me oPointClicked X * _ (Me oPointClicked Y + _ SystemInformation CaptionHeight + _ SystemInformation BorderSize Height) * ) 移动窗体 Me Location = oMoveToPoint End If
lishixinzhi/Article/program/ASP/201311/21755使用
Form1.Hide
隐藏窗体
正常来说吧,一个程序肯定有它的窗体,通过窗体才能进行一系列的 *** 作
但某些自动化的功能,不需要窗体的话
可以在Sub Form_Load中
使用代码
Form1.Hide
这大搭禅样窗体就不会显滚尘示出来,不显示出来不代表不存在,只是看不到
至于保持程枝宽序运行,VB程序只要打开了,没有死掉没有关闭,就会一直保持程序运行,等待接收消息并且作出相应的反应。具体看代码了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)