I have a (menu) bar at the top of my form. I update the bar by first clearing it, then adding my new (parent) bar items.
I notice that when I clear the Bar.Items, the bar disappears from the form. When I add the new bar items, it reappears. This causes a noticable flicker when I need to update my menu bar.
Here is the code I use:
Is there a way to prevent the bar from redrawing before I finish updating? Something like:
ADAdministrator Syncfusion Team May 12, 2005 09:04 AM
You could use the interop call LockWindowUpdate to pause and resume the main form repainting as shown in code below :
// Pause painting
// Resume painting
This should suppress any flickers that you while the main form repaints itself after the changes on it. SuspendLayout and ResumeLayout calls on the main form also might help. Please let me know if you need further assistance.
ADAdministrator Syncfusion Team May 12, 2005 07:42 PM
I tried using LockWindowUpdate but for some reason I still get the flicker (which makes no sense to me).
Currently, to avoid the flicker I''m having to insert a dummy baritem, then remove all the other baritems in the bar, then update the bar with the baritems I want, then remove the dummy baritem. This is okay for now, but it''s very sloppy.
A way to suspend the redraw of the bar while I manipulate it would be much better (something like the BeginUpdate and EndUpdate on a regular TreeView).
ADAdministrator Syncfusion Team May 13, 2005 04:16 AM
Thanks for the update. Here is a test sample that I created for this purpose and the LockWindowUpdate seems to be correctly suppressing the flickers. Please refer to it and let me know if I am missing something. Note that the use of a short Timer (as shown in the sample) might also help.
Also, we have made a few fixes in the source code to suppress the flickers in XPMenus and TabbedMDI frameworks in the recent past to address issues like defects 6, 194 and 198. These fixes will be available in the post v220.127.116.11 releases and it should take care of this issue as well. We appreciate your cooperation and thanks for your continued interest in Syncfusion products.
ADAdministrator Syncfusion Team May 15, 2005 07:30 PM
Thank you for your efforts Guru Patwal. Unfortunately, if I run your test code as is I still get the flicker!
I''m starting to think it has something to do with my machine architecture. I''m running Windows XP Professional SP1 on a Pentium 4 2.20GHz with 1 Gb RAM.
I''m running version 18.104.22.168 of Syncfusion.
ADAdministrator Syncfusion Team May 17, 2005 12:47 PM
I doubt it''s your machine architecture, as I''ve been able to reproduce the flicker myself. The flicker has been removed internally and the fix should be included in our next patch.