Few questions about threads and waitwindow


Author
Message
Robin J Giltner
Robin J Giltner
StrataFrame User (179 reputation)StrataFrame User (179 reputation)StrataFrame User (179 reputation)StrataFrame User (179 reputation)StrataFrame User (179 reputation)StrataFrame User (179 reputation)StrataFrame User (179 reputation)StrataFrame User (179 reputation)StrataFrame User (179 reputation)
Group: Forum Members
Posts: 105, Visits: 650
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 Message

Me.loWaitwindow.Message = lcMessage

End 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")


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search