AttributeCollection.CssStyle プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > AttributeCollection.CssStyle プロパティの意味・解説 

AttributeCollection.CssStyle プロパティ

現在の AttributeCollection オブジェクト属すASP.NET サーバー コントロールスタイルコレクション取得します

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

Public ReadOnly Property
 CssStyle As CssStyleCollection
Dim instance As AttributeCollection
Dim value As CssStyleCollection

value = instance.CssStyle
public CssStyleCollection CssStyle { get; }
public:
property CssStyleCollection^ CssStyle {
    CssStyleCollection^ get ();
}
/** @property */
public CssStyleCollection get_CssStyle ()
public function get CssStyle
 () : CssStyleCollection

プロパティ
現在のサーバー コントロールスタイル格納している CssStyleCollection オブジェクト

解説解説
使用例使用例

プログラムによってサーバー コントロールAttributeCollectionCSS スタイル値を追加する方法の例を次に示しますボタンクリックすると、TextBox サーバー コントロール背景色 TextBox1 は、DropDownList サーバー コントロール選択された項目 DropDownList1設定されます。

Private Sub Button2_Click(sender As
 Object, e As System.EventArgs)
   Dim myColor As String
   Dim myAttributes As AttributeCollection
 = TextBox1.Attributes
   myColor = DropDownList1.Items(DropDownList1.SelectedIndex).Text
   ' Add the attribute "background-color" in to the CssStyle.
   myAttributes.CssStyle.Add("background-color", myColor)
End Sub
private void Button2_Click(object sender, System.EventArgs
 e)
{
   
   string myColor;
   AttributeCollection myAttributes = TextBox1.Attributes;
   myColor = DropDownList1.Items[DropDownList1.SelectedIndex].Text;
   // Add the attribute "background-color" in to the CssStyle.
   myAttributes.CssStyle.Add("background-color",myColor);
   
}
private void Button2_Click(Object sender, System.EventArgs
 e)
{
    String myColor;
    System.Web.UI.AttributeCollection myAttributes = TextBox1.get_Attributes();
    myColor = DropDownList1.get_Items().get_Item(DropDownList1.
        get_SelectedIndex()).get_Text();
    // Add the attribute "background-color" in to the CssStyle.
    myAttributes.get_CssStyle().Add("background-color",myColor);
} //Button2_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AttributeCollection クラス
AttributeCollection メンバ
System.Web.UI 名前空間
CssStyleCollection


このページでは「.NET Framework クラス ライブラリ リファレンス」からAttributeCollection.CssStyle プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からAttributeCollection.CssStyle プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からAttributeCollection.CssStyle プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

AttributeCollection.CssStyle プロパティのお隣キーワード
検索ランキング

   

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



AttributeCollection.CssStyle プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS