新建From1(窗体),新建Command1-2(按钮CommandButton),代码:
Private Sub Command1_Click()
#If Win32 Then
Debug.Print Win32
MsgBox 32
#ElseIf Win16 Then
Debug.Print Win16
MsgBox 16
#End If
End Sub
Private Sub Command2_Click()
#If Win16 Then
Debug.Print Win16
MsgBox 16
#ElseIf Win32 Then
Debug.Print Win32
MsgBox 32
#End If
End Sub
不管按哪个按钮,运行结果:
都是弹出显示 32,Debug不会显示任何信息,包括True或Flase。