Vb.net 逻辑不属于第二类

Vb.net 逻辑不属于第二类,vb.net,Vb.net,我有这样的想法: If Not String.IsNullOrWhiteSpace(selectedBeginDate) AndAlso someMoreConditionsHere Then If somethingElse Then ' Do some work here End If ElseIf String.IsNullOrWhiteSpace(selectedBeginDate) Then cell.IsE

我有这样的想法:

   If Not String.IsNullOrWhiteSpace(selectedBeginDate) AndAlso someMoreConditionsHere Then
       If somethingElse Then
            ' Do some work here
       End If
   ElseIf String.IsNullOrWhiteSpace(selectedBeginDate) Then
       cell.IsEnabled = False
   ElseIf Not String.IsNullOrWhiteSpace(selectedBeginDate) Then
       cell.IsEnabled = True
   End If
在调试中,当If somethingElse Then不正确时,它会正确地转到

ElseIf String.IsNullOrWhiteSpace(selectedBeginDate) Then
因为selectedBeginDate确实有一个值,但我希望它能转到下一个其他值,如果它跳过它,它就不会正确地进入它

为什么?

另一种解决方案:

   If Not String.IsNullOrWhiteSpace(selectedBeginDate) AndAlso someMoreConditionsHere Then
       If somethingElse Then
            ' Do some work here
       End If
   Else
       cell.IsEnabled = Not String.IsNullOrWhiteSpace(selectedBeginDate) Then
   End If

如果有什么东西,就没有别的了;一旦进入系统,不应进入显示的任何其他块first@Plutonix是的,我明白了。我改变了顺序,提出了最后两个ELEFIs,所以现在先检查它们。用CytoSimple简化。ISStabe= IFSTRIGN。