D
Donald A. Fisher
Hello. I've been working a vb project and have a form with a button on
it that performs some actions after disabling the button when clicked:
Code disabling button and starting actions:
Private Sub btnCreateExcel_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnCreateExcel.Click
Me.btnCreateExcel.Enabled = False
Dim pCreateExcel As New ClassCreateExcel
AddHandler pCreateExcel.CreateExcelCompleted, AddressOf
CreateExcelCompletedEventHandler
Dim thCreateExcel As System.Threading.Thread
thCreateExcel = New System.Threading.Thread(AddressOf
pCreateExcel.Process)
thCreateExcel.Start()
End Sub
I've tried using the "CreateExcelCompleteEventHandler to re-enable the
button to no avail:
Code performed after actions are completed:
Private Sub CreateExcelCompletedEventHandler(ByVal sender As
System.Object, ByVal e As System.EventArgs)
frmCreateExcelProgress.Close()
Me.btnCreateExcel.Enabled = True
End Sub
The actions completed really don't matter (I think). I just want the
button to be disabled so the user cannot start multiple events by
double-clicking or being impatient and clicking again and then re-enable
the button after processing has finished. Any help would be great!
Thanks in advance!
Don
it that performs some actions after disabling the button when clicked:
Code disabling button and starting actions:
Private Sub btnCreateExcel_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnCreateExcel.Click
Me.btnCreateExcel.Enabled = False
Dim pCreateExcel As New ClassCreateExcel
AddHandler pCreateExcel.CreateExcelCompleted, AddressOf
CreateExcelCompletedEventHandler
Dim thCreateExcel As System.Threading.Thread
thCreateExcel = New System.Threading.Thread(AddressOf
pCreateExcel.Process)
thCreateExcel.Start()
End Sub
I've tried using the "CreateExcelCompleteEventHandler to re-enable the
button to no avail:
Code performed after actions are completed:
Private Sub CreateExcelCompletedEventHandler(ByVal sender As
System.Object, ByVal e As System.EventArgs)
frmCreateExcelProgress.Close()
Me.btnCreateExcel.Enabled = True
End Sub
The actions completed really don't matter (I think). I just want the
button to be disabled so the user cannot start multiple events by
double-clicking or being impatient and clicking again and then re-enable
the button after processing has finished. Any help would be great!
Thanks in advance!
Don