In Windows.Forms, you can Button.Refresh() .
In Windows.Forms or WPF, you can submit messages to the pump to redraw. Async / Await was designed to allow you to do this without the muck of an HCL response.
Private Async Function Button_OnClick Button.Enabled = False Await Task.Yield [LONG OPERATION] End Function
David jeske
source share