S
swilson-musco
Guest
Just setting the stage here...I am not a 4GL expert but was trying to show our developers how to use background threads in VB.NET to use animated images on forms. So I created a Progress .NET form with a button and put this code in the click event so that the foreground thread would be busy..to show that animated images need their own thread or that the processing needed to be a separate worker thread from the form. def variable i as integer init 0. pictPleaseWait:Visible = true. lblStart:Text = STRING(NOW). process events. do while i < 999999999 : i = i + 1. end. pictPleaseWait:Visible = false. lblEnd:Text = STRING(NOW). RETURN. Now here is the code on my vb.net form with code behind on click event. Dim i As Integer = 0 lblStart.Text = Now.ToLongTimeString pictPleaseWait.Visible = True Application.DoEvents() Do While i < 999999999 i = i + 1 Loop pictPleaseWait.Visible = False lblEnd.Text = Now.ToLongTimeString The progress code takes minutes to run...the vb code takes seconds.... Any idea why? Thanks, Scott
Continue reading...
Continue reading...