We have noticed a minor difference in how VB6 and .NET behave if the Form_Load event handler contains these statements:
Option1.Value = True
Option1.Enabled = False
Under VB6, the above statement cause the enabled OptionButton control with the lowest TabIndex value to become checked (i.e. Value=True), whereas under .NET the Option1 control will be checked even if it is disabled.
If your migrated code relies on the VB6 behavior, the only way to have it work correctly is emulating such a behavior, which you can do by means of the following method:
Public Sub SetCheckedOptionButton(container As Control)
If container Is Nothing Then Return
Dim nextOptionButton As VB6OptionButton
For Each ctrl As Control In container.Controls
Dim tempOptionButton As VB6OptionButton = TryCast(ctrl, VB6OptionButton)
If tempOptionButton IsNot Nothing Then
If tempOptionButton.Checked Then
If tempOptionButton.Enabled Then Return
Else
If tempOptionButton.Enabled Then
If nextOptionButton Is Nothing Then
nextOptionButton = tempOptionButton
Else
If nextOptionButton.TabIndex > tempOptionButton.TabIndex Then
nextOptionButton = tempOptionButton
End If
End If
End If
End If
End If
Next
If nextOptionButton IsNot Nothing Then nextOptionButton.Checked = True
End Sub
The SetCheckOptionButton is meant to be invoked from inside the Form_Load event handler, or immediately after you change the Enabled or Value properties of one or more OptionButton controls in a group.