VB6 supports the vbDefaultButton4 enumerated constants, which has the value 768 (or hex 300). VB.NET message boxes don’t support four buttons, therefore VB Migration Partner converts this constant as MsgBoxStyle.DefaultButton1 (whose value is 0). In the majority of cases this transformation works perfectly.
There are rare cases, however, when the conversion causes an issue. For example, assume that you are reading a value from an external source – for example, a file or an external COM object, and that your code contains this statement:
Dim value As VbMsgBoxStyle
value = ReadValueFromFile()
If value = vbDefaultButton4 Then DoSomething
which is translated as follows:
Dim value As MsgBoxStyle = ReadValueFromFile()
If value = MsgBoxStyle.DefaultButton1 Then DoSomething
Under VB6 this code invokes the DoSomething method if the value read from file is equal to 768, whereas under VB.NET the method is invoked when the read value is zero.
The solution to this problem is quite simple: just add a PreProcess pragma that modifies all occurrences of vbDefaultButton4 into its numeric value: