Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Why won't controls on the windows form update/refresh after done with processing?

$
0
0
  • Created a test windows application, which have one UI with one text box and couple of combo box.
  • The combo boxes are disabled on text change of the textbox and enabled after some processing. In code we have not added ‘Window.Refresh()’ method at the end of processing code block, which forces repaint of the controls.
  • On change of the text it starts the inter-process communication with COM server.
  • Observed that on change of the text it invokes the COM service and after execution return back from COM server to client (UI), the WM_PAINT message receives in the Windows::WndProc() method.
  • Even though the WM_PAINT message received, the controls on the UI look disabled. When we move a mouse over the control then they gets enabled but the WM_PAINT message does not come in Windows::WndProc() method.
  • On the other hand if we add ‘Window.Refresh()’ method in code after completion of the process then the controls on the UI gets enabled. I do not want to call this refresh method post processing.

Another option that I tried was putting the main thread to sleep for some seconds instead of invoking the COM service. In this case the UI was refreshed correctly.

How can we enable the control after cross processing?

Please guide me on this issue.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>