VB Migration Partner

KNOWLEDGE BASE - Forms and controls


Previous | Index | Next 

[PRB] VB.NET forms don’t display the size grip handle

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()
            '## InsertStatement Me.SizeGripStyle = Windows.Forms.SizeGripStyle.Auto
            ' …
        End Sub

You can safely add this statement if any of the following conditions is met:

  1. you don’t execute graphic methods – Line, Circle, PaintPicture, etc. – to display graphics on the form (or on any of its child controls)
  2. the form or the child control’s AutoRedraw property is set to True
  3. 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.

Previous | Index | Next 




Follow Francesco Balena on VB6 migration’s group on

LinkedIn





Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.




Code Architects and its partners offers remote and onsite migration services.

More details




Subscribe to our free newsletter for useful VB6 migration tips and techniques.

newsletter



To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice



A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial




The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote




Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers