http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=152101&authorid=0&page=0&star=1
我按照这个帖子里面的做了一个等待界面。但是我想定期刷新里面的内容,请问怎么做?
代码是
Public delimgng As image =GetImage("bei.png")
Private waitMess As New System.Windows.Forms.Form()
Private sFlog As Boolean = True
Private Sub ShowWaitMess()
Dim waitMesspic As New System.Windows.Forms.PictureBox()
Dim waitMesspic2 As New System.Windows.Forms.TextBox()
waitMesspic.Image = System.Drawing.Image.FromFile(ProjectPath & "Images\timg2.gif")
waitMesspic.Dock = System.Windows.Forms.DockStyle.fill
waitMesspic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
waitMesspic2.text=Vars("loadingtext") 我想定期刷新这个,而Vars("loadingtext") 是在内部函数里面变化。
waitMesspic2.AutoSize=True
waitMesspic2.BackColor = Color.white
waitMesspic2.top = 70
waitMesspic2.left = 40
waitMesspic2.Font = new Font("weiruanyahei",10.25,FontStyle.Regular)
waitMess.Controls.Add(waitMesspic2)
waitMess.Controls.Add(waitMesspic)
waitMesspic2.BringToFront()
waitMess.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
waitMess.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
waitMess.TransparencyKey = Color.red
waitMess.OPacity = 0.9
waitMess.Width = 328 '固定大小
waitMess.Height = 120
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
内部函数
WaitShow() '打开
Dim ik As Integer
Do
ik+=1
Vars("loadingtext") ="请等待" & ik
Loop While ik <= 1000000
WaitClose() '关闭
Return Nothing
请帮忙看下这个怎么改。