Private Sub Button1_Click(sender As Object, e As RoutedEventArgs) Handles Button1.Click Dim flag As Boolean = False Dim ret As Boolean? = If(flag, True, Nothing) End Sub