[Mono-list] Windows.Forms control flicker and wrapper classes.

Alan McGovern alan.mcgovern at gmail.com
Fri Dec 1 10:58:16 EST 2006

Why not just use TreeView.BeginUpdate() to disable repainting, and after
you've finished updating the treeview call treeView.EndUpdate() which will
reenable repainting. That will stop the flickering.


On 11/30/06, Bouk, Nathan <NBouk at plansys.com> wrote:
>  I've been developing a Windows.Forms app, and I've been trying to
> maintain compatibility with Mono at the same as MS .NET. I recently tried
> using the Windows.Forms.Treeview control, and found that it sucked. The
> underlying native control was fine, but the Windows.Forms wrapper was so
> poorly written it caused it to flicker like it was going out of style (and
> it is!). To fix this I started using a wrapper class around
> Windows.Forms.Treeview that inherits from Treeview, but hijacks the
> WndProc() function, and in order to enforce strict double buffering, it had
> to call a few Win32 functions that aren't nicely wrapped in .Net
> (GetUpdateRect, BeginPaint, and EndPaint) which were used with PInvoke. The
> class can be found on codeproject at
> http://www.codeproject.com/cs/miscctrl/genmissingpaintevent.asp, and it
> solves the flickering problem nicely, but now my project has a huge Win32
> dependency.
> Does anyone have any ideas how I can maintain one project that can use
> this TreeViewWithPaint class in Microsoft .NET, but use the Mono
> Windows.Forms.Treeview when running on Mono?
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20061201/20d82560/attachment.html 

More information about the Mono-list mailing list