Wait Window


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Trying to get the SF wait window control to behave like my old friend THE wait window.



I looked thruough all the overloads and dont see the ability to pause.



I am looping through a few dozen files and want to put in enough of a pause so that each wait window displays the filename is briefly visible. Right now it processes so fast all I see is the last one.



My code:



While en.MoveNext

information = My.Computer.FileSystem.GetFileInfo(CStr(en.Current))

Me.WaitWindow1.ShowWaitWindow("", information.FullName, MicroFour.StrataFrame.Messaging.MessagingCardinalPosition.NorthEast)

'Me.WaitWindow1.HideWaitWindow()

filecount += 1

End While

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Ill follow up with how do you pause in .NET period?



I have looked before, found not much I liked and created an empty loop from 1 to x Blush

Keith Chisarik
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Unlike FoxPro, the Wait Windows does not share the same thread as the UI...which is a very good thing.  To add your own pause, just pause the current thread.

System.Threading.Thread.Sleep(1000)

The Wait Window is not an exact feature by feature replica otherwise it wouldn't work when you really need it to Smile  One major downside of the FoxPro Wait Window was the way it actually waited in certain scenarios.  Also, when the UI was taxed, it would not refresh properly.  That is why the SF Wait Window is actually on a separate thread than the thread you are working on.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
FYI, creating loops as you mentioned can be very costly on the system resources and does not truly pause the application.
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Yes I knew it was bad but I only did it once *cough*



Now I am throughly frustrated and am going home Ermm



I added the thread.sleep(1000) line and yes, it pauses the thread (I had tried this before I asked BTW), but it doesnt refresh my wait window values. I tried it with just a label on the form. When I step through it I see the value change, but the screen never refreshes till the end of the loop.



I'll come at it and the XML import tomorrow with a fresh outlook.



Thanks for the help guys.

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Please tell me why the below code will not work. I think it should display a wait window that says "hi" for 5 seconds, then count from 1 to 5. It does neither. Please help.



Me.WaitWindow1.Message = "hi"

Me.WaitWindow1.ShowWaitWindow()



System.Threading.Thread.Sleep(5000)



Dim x As Integer

For x = 1 To 5

Me.WaitWindow1.Message = x.ToString

Me.WaitWindow1.ShowWaitWindow()

System.Threading.Thread.Sleep(1000)

'Me.WaitWindow1.HideWaitWindow() (optional)

Next

Keith Chisarik
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Try this:

Me.WaitWindow1.ShowWaitWindow("hi")

System.Threading.Thread.Sleep(5000)

For x As Integer = 1 To 5
    Me.WaitWindow1.Message = x.ToString
    System.Threading.Thread.Sleep(1000)
Next

Me.WaitWindow1.HideWaitWindow()

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
That does nothing as well for me Ben Sad

Keith Chisarik
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Hrm, it worked for me... when are you showing that wait window? in the Load of a form? or after the form is already up?
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I just put your code in a button click event, the simplest implementation I could think of just to get it working.

Keith Chisarik
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