Top 1 tips for VB.NET developers
-
Ok, its true I have only one tip, not the usual 1001 tips for VB 8-) I have been heavily developing my Theme control system and need flicker free drawing on the surface of a panel. The solution was so sweet I just thought I would share it for two reasons. 1) See how simple things are to do in .NET, 2) I can't see a forum for sharing little nuggets...oh 3) was going to be you can see what a God I have become at this stuff in only 2 weeks (BOW MORTALS!) hahaha ' Create a panel whose Graphics object is double buffered to eliminate flicker when drawing Public Class BufferedPanel Inherits Panel Sub New() SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.DoubleBuffer Or ControlStyles.UserPaint, True) End Sub End Class Jeez, that was a big build up for such a poxy one line of code, but there you go. If you want flicker free drawing, just inherit a control and stick a SetStyle on it. In the Paint event of the BufferedPanel you draw anything you want to and its flicker free. Thanks for reading! Nursey