DisplayNameAttribute クラスとは? わかりやすく解説

DisplayNameAttribute クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

引数受け取らないプロパティイベント、またはパブリックvoid メソッド表示名指定します

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Method
 Or AttributeTargets.Property Or AttributeTargets.Event)>
 _
Public Class DisplayNameAttribute
    Inherits Attribute
Dim instance As DisplayNameAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event)]
 
public class DisplayNameAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Method|AttributeTargets::Property|AttributeTargets::Event)]
 
public ref class DisplayNameAttribute : public
 Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event)
 */ 
public class DisplayNameAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event)
 
public class DisplayNameAttribute extends
 Attribute
解説解説
使用例使用例

DisplayNameAttribute クラス使用して、PropertyGrid コントロールで、MisnamedProperty呼ばれるプロパティの名前を RenamedProperty変更するコード例次に示しますコード全体については、「方法 : Windows フォーム コントロール属性適用する」を参照してください

' This property exists only to demonstrate the 
' DisplayName attribute. When this control 
' is attached to a PropertyGrid control, the
' property will be appear as "RenamedProperty"
' instead of "MisnamedProperty".
<Description("Demonstrates DisplayNameAttribute."),
 _
DisplayName("RenamedProperty")> _
Public ReadOnly Property
 MisnamedProperty() As Boolean
    Get
        Return True
    End Get
End Property
// This property exists only to demonstrate the 
// DisplayName attribute. When this control 
// is attached to a PropertyGrid control, the
// property will be appear as "RenamedProperty"
// instead of "MisnamedProperty".
[Description("Demonstrates DisplayNameAttribute.")]
[DisplayName("RenamedProperty")]
public bool MisnamedProperty
{
    get
    {
        return true;
    }
}
継承階層継承階層
System.Object
   System.Attribute
    System.ComponentModel.DisplayNameAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DisplayNameAttribute メンバ
System.ComponentModel 名前空間
GetSortedActionItems



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DisplayNameAttribute クラス」の関連用語

DisplayNameAttribute クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DisplayNameAttribute クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS