2009-12-05 42 views
0

我正在使用Visual C#2008 express。我也运行Windows 7.我创建了一个简单的表单,但Intellisense没有显示我写的任何内容。 我写:智能感知不显示我写的任何东西

private RadioButton rbtn_sortLocation; 

,然后当我写rbtn,智能感知弹出,但它并不显示rbtn_sortLocation。但写完整行后,它不会抱怨错误。我如何获得Intellisense来展示我的方法等?

另外:这只发生在我在这台计算机上创建的解决方案。我在旧XP机器上创建的所有解决方案均正常工作。

回答

1

你可以给Ctrl + Space一枪。它是一种手动提取Intellisense菜单的方式。

您还可以检查您的选项以确保其打开。我相信intellisense选项是在Tools -> Options -> Text Editor -> (All Languages or the language you are using) -> Statement Completion section -> Auto list members

+0

对不起,我写错了我的问题。菜单显示出来,但它不包括我的方法或任何我写的东西。 – Relikie 2009-12-05 23:53:14

0

你在写'rbtn'并试图打开智能感知?另外,这个RadioButton在哪里宣布?

智能感知使用基于范围的选项填充菜单。例如:(假设RadioButton是在课堂级声明的)

class MyClass 
{ 
    private RadioButton rbtn_sortLocation; 

    // Intellisense will not show the RadioButton in this scope. 
    // This is the class scope, not in a method. 

    static void StaticMethod() 
    { 
     // Intellisense will not show the RadioButton in this scope. 
     // The RadioButton is not static, so it requires an instance. 
    } 

    class InnerClass 
    { 
     // Intellisense will not show the RadioButton in this scope. 
     // This is the class scope, not in a method. 

     void InnerClassMethod() 
     { 
      // Intellisense will not show the RadioButton in this scope. 
      // Members of the outer class are not accessible to an inner class. 
     } 
    } 

    public MyClass() 
    { 
     // Intellisense WILL show the radio Button in this scope. 
     // class members are accessible to the constructor. 
    } 

    void Method() 
    { 
     // Intellisense WILL show the radio Button in this scope. 
     // class members are accessible to instance methods. 
    } 
}