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

ToolboxDataAttribute クラス

Microsoft Visual Studio などのツールツールボックスからドラッグされるときに、カスタム コントロール生成される既定タグ指定します

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

<AttributeUsageAttribute(AttributeTargets.Class)> _
Public NotInheritable Class
 ToolboxDataAttribute
    Inherits Attribute
Dim instance As ToolboxDataAttribute
[AttributeUsageAttribute(AttributeTargets.Class)] 
public sealed class ToolboxDataAttribute :
 Attribute
[AttributeUsageAttribute(AttributeTargets::Class)] 
public ref class ToolboxDataAttribute sealed
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class) */ 
public final class ToolboxDataAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Class) 
public final class ToolboxDataAttribute extends
 Attribute
解説解説
使用例使用例
[ ToolboxData("<{0}:MyLabel runat= server Text= 
       MyLabel><{0}:MyLabel>") ]public class MyLabel : Label {...}

上記コードによって MyLabel固有のプロパティいくつか設定する例を次に示しますすべての {0} が、デザイナによって、MyLabel クラス関連付けられているタグ プリフィックス置換されます。

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls


Namespace CustomControls
  <ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow'
 BackColor='Magenta' BorderWidth = '10'  runat='server'></{0}:MyLabel>")>
  _
  Public Class MyLabel
    Inherits Label
     
    Public Sub New()
      'Your code goes here.
    End Sub 'New
    
  End Class 'MyLabel
  
End Namespace 'CustomControls


using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace CustomControls
{

  [ ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow' BackColor='Magenta'
 BorderWidth = '10'  runat='server'></{0}:MyLabel>") ]    
  public class MyLabel : Label 
  {
    public  MyLabel()
    { 
      // Your code goes here.
    } 
  }

}

import System.*;
import System.Web.*;
import System.Web.UI.*;
import System.Web.UI.WebControls.*;

/** @attribute ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow'"
    + "BackColor='Magenta' BorderWidth = '10'  runat='server'></{0}:MyLabel>")
 */
public class MyLabel extends Label
{
    public MyLabel()
    {
        // Your code goes here.
    } //MyLabel
} //MyLabel
継承階層継承階層
System.Object
   System.Attribute
    System.Web.UI.ToolboxDataAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「ToolboxDataAttribute クラス」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS