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

Bouk, Nathan NBouk at PLANSYS.COM
Thu Nov 30 18:12:37 EST 2006


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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20061130/6d14ff79/attachment.html 


More information about the Mono-list mailing list