如何使第二个事件在第一个事件之后开始。 下面是一个代码,用于复制用户为我设置的2个不同路径中的文件。另一方面,它希望在进入下一个路径之前从另一个路径创建第一个副本。
Public Sub StartCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartCopy.Click
' Reset variables
_stopped = False
' Create the FileCopy class which will initiate the threads
CopyFiles = New FileCopy
CopyFiles.FromPath = My.Settings.pathmemfrom1
CopyFiles.ToPath = My.Settings.pathmemto1
' Initiate the copy, count from the FileCopy class
CopyFiles.StartCopy()
WorkingBar.Minimum = 0
WorkingBar.Maximum = 100
WorkingLabel.Visible = True
WorkingBar.Visible = True
' Reset form controls
setting.Panel.Enabled = False
StopCopy.Enabled = True
ViewLog.Enabled = True
CopyFiles.Dispose()
'Reset veriables
_stopped = False
' Create the FileCopy class which will initiate the threads
CopyFiles2 = New FileCopy
CopyFiles2.FromPath = My.Settings.pathmemfrom2
CopyFiles2.ToPath = My.Settings.pathmemto2
CopyFiles2.StartCopy()
WorkingBar.Minimum = 0
WorkingBar.Maximum = 100
WorkingLabel.Visible = True
WorkingBar.Visible = True
' Reset form controls
setting.Panel.Enabled = False
StopCopy.Enabled = True
ViewLog.Enabled = True
CopyFiles2.Dispose()
'Reset veriables
_stopped = False