2009-12-05 41 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. 
    } 
}