DesignerAutoFormatCollection.Add メソッド
アセンブリ: System.Design (system.design.dll 内)

Dim instance As DesignerAutoFormatCollection Dim format As DesignerAutoFormat Dim returnValue As Integer returnValue = instance.Add(format)
戻り値
コレクションに追加された書式のインデックス位置。

Add メソッドは、指定した DesignerAutoFormat オブジェクトをコレクションの末尾に追加します。DesignerAutoFormat オブジェクトをコレクションの特定のインデックス位置に追加するには、Insert メソッドを使用します。

DesignerAutoFormat オブジェクトを作成してカスタム デザイナの AutoFormats プロパティに追加するコード例を次に示します。
' The collection of AutoFormat objects for the IndentLabel object Public Overrides ReadOnly Property AutoFormats() As DesignerAutoFormatCollection Get If _autoFormats Is Nothing Then ' Create the collection _autoFormats = New DesignerAutoFormatCollection() ' Create and add each AutoFormat object _autoFormats.Add(New IndentLabelAutoFormat("MyClassic")) _autoFormats.Add(New IndentLabelAutoFormat("MyBright")) _autoFormats.Add(New IndentLabelAutoFormat("Default")) End If Return _autoFormats End Get End Property
// The collection of AutoFormat objects for the IndentLabel object public override DesignerAutoFormatCollection AutoFormats { get { if (_autoFormats == null) { // Create the collection _autoFormats = new DesignerAutoFormatCollection(); // Create and add each AutoFormat object _autoFormats.Add(new IndentLabelAutoFormat("MyClassic")); _autoFormats.Add(new IndentLabelAutoFormat("MyBright")); _autoFormats.Add(new IndentLabelAutoFormat("Default")); } return _autoFormats; } }


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- DesignerAutoFormatCollection.Add メソッドのページへのリンク