Here is the scenario. In the item click event of a ListView object I want HideWhileProcessing() to hide one button and make another button visible for 5 seconds. However during my Do While Loop the screen does not update. What is the best way to accomplish this 5 second hiding of a button, then making it visible again once completed?
Sub HideWhileProcessing()
Dim five_seconds As Long = 5 * DateTime.TicksPerSecond
Dim expirationDateTime As Long = DateUtils.SetDateAndTime(DateTime.GetYear(DateTime.Now), DateTime.GetMonth(DateTime.Now),DateTime.GetDayOfMonth(DateTime.Now), DateTime.GetHour(DateTime.Now), DateTime.GetMinute(DateTime.Now), DateTime.GetSecond(DateTime.Now))
expirationDateTime = expirationDateTime + five_seconds
Do While (DateTime.Now < expirationDateTime)
imgRedo.Visible = False
imgProcessing.Visible = True
imgProcessing.Visible = True
Loop
imgRedo.Visible = True
imgProcessing.Visible = False
End Sub
Sub HideWhileProcessing()
Dim five_seconds As Long = 5 * DateTime.TicksPerSecond
Dim expirationDateTime As Long = DateUtils.SetDateAndTime(DateTime.GetYear(DateTime.Now), DateTime.GetMonth(DateTime.Now),DateTime.GetDayOfMonth(DateTime.Now), DateTime.GetHour(DateTime.Now), DateTime.GetMinute(DateTime.Now), DateTime.GetSecond(DateTime.Now))
expirationDateTime = expirationDateTime + five_seconds
Do While (DateTime.Now < expirationDateTime)
imgRedo.Visible = False
imgProcessing.Visible = True
imgProcessing.Visible = True
Loop
imgRedo.Visible = True
imgProcessing.Visible = False
End Sub