在屬性網格中,當您選擇一個專案時,它會在底部的框中??顯示 [description("")] 幫助文本。

當您使用屬性網格的分類視圖時,您還可以選擇類別名稱本身

我的問題是,有沒有辦法為所選類別提供描述,該描述的顯示方式與屬性的描述標簽顯示方式相同?例如,當您選擇輸入時,您可能會看到
Input
Items in this category are related to Input
此外,如果它相關,我只是使用一個標準屬性網格,該網格由一個包含用描述和類別標記的屬性的類填充
public class Foo
{
[Category("Foo Category")]
[Description("Foo Description help text")]
public string fooProperty { get; set; } = "";
}
uj5u.com熱心網友回復:
屬性網格是“開源的”。
此描述文本由此https://referencesource.microsoft.com/#system.windows.forms/winforms/Managed/System/WinForms/PropertyGridInternal/PropertyGridView.cs,4496設定
this.ownerGrid.SetStatusBox(gridEntry.PropertyLabel,gridEntry.PropertyDescription);
而gridEntry對于一類是由處理CategoryGridEntry類https://referencesource.microsoft.com/#system.windows.forms/winforms/Managed/System/WinForms/PropertyGridInternal/CategoryGridEntry.cs其匯出從GridEntry類定義PropertyDescription此屬性的https:/ /referencesource.microsoft.com/#system.windows.forms/winforms/Managed/System/WinForms/PropertyGridInternal/GridEntry.cs,909由這個:
public virtual string PropertyDescription {
get {
return null;
}
}
這個屬性在 中沒有被覆寫CategoryGridEntry,所有這些都是內部代碼,所以,不,你不能有類別網格條目的描述。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/357982.html
