This section describes the differences between VB6 and .NET controls and the problems you can find in migrating VB6 applications with user-interface. The differences that are common to most controls are described in the Controls (general) section.

For a list of differences between VB6 and VB.NET language, see here.

Unless otherwise stated, VB Migration Partner fully supports all the Visual Basic 6 features mentioned in this page. It is worth noticing that names of properties and methods are preserved, which ensures that those even late-bound references work correctly after the migration to VB.NET. For more information, please read the manual and the knowledge base section.





HScrollBar and VScrollBar controls

Change event

The Change event isn’t supported and has been replaced by the ValueChanged event.



LargeChange property

.NET scrollbars deal with this property in a very special way: if the value of this property is higher than 1 and isn’t a divisor of the Maximum value, then the end user can’t click below or above the thumb indicator to scroll the bar to a value higher than Max-LargeChange+1. For example, if Maximum=255 and LargeChange=10 then the scrollbar can’t be scrolled to a value other than 250. No range limit is enforced if clicking on the scrollbar arrows, though.

This limitation is inherent to the .NET Framework and VB Migration Partner can only attempt to make the problem less serious. The easiest way to ensure that the converted VB.NET application works well is forcing the LargeChange property to be equal to 1 and ignoring all assignments to it. The neat result is that the end user can move the thumb indicator up to its maximum position, even if the scrollbar will react more slowly.

This feature can be controlled by means of the IgnoreLargeChange property, whose default value is True. If you set this value to False, values assigned to the LargeChange property become immediately effective and the scrollbar will behave similarly to the original VB6 program.



Min and Max properties

The Min and Max properties aren’t supported and map to Minimum and Maximum properties, respectively.

Even more important is that VB6 supports scrollbars whose minimum value is higher than its maximum value, a setting that is useful to implement scrollbars that work in nonstandard way (for example, a vertical scrollbar whose bottommost position corresponds to the minimum value). This arrangement isn’t available for .NET scrollbars, as this code demonstrates:

        HScroll1.Minimum = 1
        HScroll1.Maximum = 100
        HScroll1.Minimum = 200             ' higher than Maximum!
        Debug.WriteLine(HScroll1.Maximum)  ' displays "200"

Converting such scrollbars to VB.NET using the Upgrade Wizard can be quite cumbersome. VB Migration Partner fully supports the Min and Max properties and, above all, supports the VB6 behavior and guarantees that functional equivalence is preserved.



Scroll event

The Scroll event is supported, with a caveat: in VB6 the Value property has been already updated when the event fires, whereas in VB.NET the Value property contains the previous value when the event fires. You can learn the updated Value property by querying the NewValue property of the ScrollEventArg object passed as an argument to the event handler.

VB Migration Partner fully supports this event and automatically accounts for this minor difference: when the Scroll event fires, the Value property has been already updated with the new value.