How to paint our changes in runtime before its being viewe by user

不问归期 提交于 2019-12-11 23:51:37

问题


I am having a windows form that whenever I want its controls like picturebox update normally I need to hide it and show it to let the cahnges happen. This causes a blink which I want to avoid.

Does anybody know what are my options? It is a picture box from form1 being copied to form2 and let the user see the changes.

Thanks


回答1:


Why can you not change the control's attributes without hiding it?

Some options:

  1. Don't hide the controls before changing them.
  2. Show a loading animation overlay for the controls being updated (or the entire form if you are updating more than just a few).
  3. I'm not quite sure exactly what you're trying to do, but double buffering may help you out.

If these options don't help, please describe your issue in more detail and I will try to provide assistance.




回答2:


I don't know if this will help, but, instead of hiding the picturebox, you can try:

PictureBox.Invalidate();

after you copy the picturebox



来源:https://stackoverflow.com/questions/5117371/how-to-paint-our-changes-in-runtime-before-its-being-viewe-by-user

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!