Foxtable(狐表)用户栏目专家坐堂 → 求助等待窗口


  共有3747人关注过本帖树形打印复制链接

主题:求助等待窗口

帅哥哟,离线,有人找我吗?
18523982317
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:857 积分:6156 威望:0 精华:0 注册:2015/12/24 13:02:00
求助等待窗口  发帖心情 Post By:2022/1/14 16:02:00 [只看该作者]

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=73365&skin=0

用起来了,没问题,就是等待时间有点长,如何变短?或者能够根据程序加载数据的进度来自动调节显示时间?


放在全局代码里面的:
Private waitMess As New System.Windows.Forms.Form()
'等待窗体
Private sFlog As Boolean = True
Private Sub ShowWaitMess()
    Dim waitMesspic As New System.Windows.Forms.PictureBox()
    waitMesspic.Image = System.Drawing.Image.FromFile(ProjectPath & "Images\loading.gif")  
    waitMesspic.Dock = System.Windows.Forms.DockStyle.Fill
    waitMesspic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
    waitMess.Controls.Add(waitMesspic)
    waitMess.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
    waitMess.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
    waitMess.TransparencyKey = Color.red
    waitMess.OPacity = 0.9
    waitMess.Width = 1280/1.5  '固定大小
    waitMess.Height = 720/1.5
    'waitMess.Width = SysInfo.WorkingAreaWidth '屏幕大小
    'waitMess.Height = SysInfo.WorkingAreaHeight
    Try
        If Not waitMess.IsDisposed Then
            waitMess.ShowDialog()   
        End If
    Catch Err As System.Threading.ThreadAbortException
        MessageBox.Show(Err.Message)
    End Try
End Sub

Public Sub WaitShow()
    Try
        If sFlog = True Then
            sFlog = False
            Dim upgradeThread As System.Threading.Thread = Nothing
            upgradeThread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf ShowWaitMess))
            upgradeThread.Start()
        End If
    Catch Err As System.Threading.ThreadAbortException
        MessageBox.Show(Err.Message)
    End Try
End Sub

Private Delegate Sub CloseFormDelegate()
Public Sub WaitClose()
    If waitMess.InvokeRequired Then
        waitMess.Invoke(New CloseFormDelegate(AddressOf DoCloseJob))
    Else
        DoCloseJob()
    End If
End Sub

private Sub DoCloseJob()
    Try
        If Not waitMess.IsDisposed Then
            sFlog = True
            waitMess.Close()   
        End If
    Catch Err As System.Threading.ThreadAbortException
        MessageBox.Show(Err.Message)
    End Try
End Sub
[此贴子已经被作者于2022/1/14 16:02:46编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
18523982317
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:857 积分:6156 威望:0 精华:0 注册:2015/12/24 13:02:00
  发帖心情 Post By:2022/1/14 16:44:00 [只看该作者]

已经找到答案了,打开关闭中间加载的数据太多了。。。

 回到顶部