By default, a resizable .NET form displays a size grip handle in the lower right corner. You might have noticed that resizable forms in converted VB.NET applications don’t include such a handle. This behavior is by design and has been implemented because the handle causes additional WM_ERASEBKGROUND messages, which in turn have the undesirable effect of clearing any graphic output that was created on the form’s surface as well as on the surface of any PictureBox and UserControl hosted on the form.
You can restore the size grip handle by setting the following property in the handler of the form Load event, for example by means of an InsertStatement pragma:
Private Sub Form_Load()
You can safely add this statement if any of the following conditions is met:
- you don’t execute graphic methods – Line, Circle, PaintPicture, etc. – to display graphics on the form (or on any of its child controls)
- the form or the child control’s AutoRedraw property is set to True
- all the graphic methods are executed in the event handler for the Paint event of the form or the child control
If you create your graphic inside the Paint event handler (third case), keep in mind that you will experience more flickering than usual.