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.

Alan.

On 11/30/06, Bouk, Nathan <[EMAIL PROTECTED]> 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  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list



_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to