I need to invoke the vb threading gods of the forum. I'm very new to delegates and cross form method calls etc.I have a main form with a class level WaitWindow that methods on the form can show, hide, update whatever. This form makes several calls to a class that performs a lot of data manipulation. Some of these take a long time, so I decided updating the WaitWindow would be nice to let the user know something is going on.
My declaration of the WaitWindow on the form.
Public WithEvents loWaitWindow As New MicroFour.StrataFrame.Messaging.WaitWindow Here is my method to Update that WaitWindow
Public Sub UpdateWaitWindow(ByVal lcMessage As String)'-- Update the Wait Window MessageMe.loWaitwindow.Message = lcMessageEnd Sub And on my class that does the data manipulation, I added this delegate
Public Delegate Sub UpdateWaitWindow(ByVal lcMessage As String) And I added a Reference to the main Form to call UpdateWaitWindow on
Public Shared loForm As frmProjectMain = CType(Application.OpenForms("frmProjectMain"), frmProjectMain) Now should I be able to call this UpdateWaitWindow by simply ?
loForm.Invoke(
New UpdateWaitWindow(AddressOf loForm.UpdateWaitWindow), "new message")