' selectionColor设置'不是System.Windows.Forms.TextBox'的成员。

时间:2015-07-27 08:07:24

标签: vb.net

我的设计师中有一个richtextbox,我有这个代码

 Imports System.Drawing

 'Some codes here
 'Some codes here
 'Some codes here
 'Some codes here

 rtbDisplay.SelectionColor = Color.Red

然后每当我运行应用程序时,我都会收到此错误

'SelectionColor' is not a member of 'System.Windows.Forms.TextBox'.

虽然我已导入Imports System.Drawing但我仍然收到此类错误。

1 个答案:

答案 0 :(得分:0)

<强>答案:

我刚才意识到rtbDisplay是textbox而不是richtextbox。这就是为什么它不知道SelectionColor