在VB .Net 3.5 VS2012中无法识别if() [英] if() not recognized in VB .Net 3.5 VS2012

查看:156
本文介绍了在VB .Net 3.5 VS2012中无法识别if()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚问了一个问题,答案中建议使用 If()函数。

I just asked a question, where the answer proposed to use the If() function.

我在Visual Studio中尝试过,但似乎不存在...

I tried in my Visual Studio, but it seems not present...

这是Intellisense的屏幕截图:
< img src = https://i.stack.imgur.com/yPyVk.png alt =在此处输入图片描述>

Here is a screenshot of the Intellisense :

仅向我展示了经典的If结构。

It only shows me the classical If structure.

当我完全写完

If(True, Debug.Write("A"), Debug.Write("B"))

我收到语法错误,说:


如果必须以相应的End If结尾

If must end by a corresponding End If

我在这里缺少什么?

.Net Framework 3.5

.Net Framework 3.5

Visual Studio 2012 Express

Visual Studio 2012 Express

该项目是一个控制台应用程序然后我也在Winforms中尝试过...

The project is a Console Application and I tried also in Winforms...

推荐答案

If() operator 返回一个值,尝试:

The If() operator returns a value, try:

Debug.Write(If(True, "A", "B"))

这篇关于在VB .Net 3.5 VS2012中无法识别if()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆