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

PanelStyle クラス

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

Panel コントロールスタイル表します

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

Public Class PanelStyle
    Inherits Style
public class PanelStyle : Style
public class PanelStyle extends Style
public class PanelStyle extends
 Style
解説解説
使用例使用例

PanelStyle オブジェクトの作成とそのプロパティ設定を行うコード例次に示します。この例は、次の 2 つ部分構成されます。

新しPanelStyle オブジェクトの作成とそのプロパティ設定方法を示す部分クラスである PanelStylecs_aspx

コード例PanelStylecs_aspx分離コード ファイルとして使用する Web フォーム ページ

この例の最初部分は、PanelStyle オブジェクトの作成myPanelStyle、およびプロパティ設定示します。ApplyStyle メソッドPanel1 パネルPanel2 パネル両方に対して呼び出され、その両方myPanelStyle適用されます。

Partial Class PanelStylevb_aspx
    Inherits Page

    Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)

        Dim panelState As StateBag = New
 StateBag()
        Dim myPanelStyle As PanelStyle = New
 PanelStyle(panelState)

        ' Set the properties of the PanelStyle class.
        myPanelStyle.HorizontalAlign = HorizontalAlign.Center
        myPanelStyle.ScrollBars = ScrollBars.Both
        myPanelStyle.Wrap = False
        myPanelStyle.Direction = ContentDirection.LeftToRight
        myPanelStyle.BackImageUrl = "~\images\picture.jpg"

        ' Use the ApplyStyle method of the Panel control to apply
        ' the settings from the myPanelStyle object.
        Panel1.ApplyStyle(myPanelStyle)
        Panel2.ApplyStyle(myPanelStyle)
        
    End Sub

End Class
public partial class PanelStylecs_aspx : Page
{
    void Page_Load(object sender, EventArgs e)
    {
        StateBag panelState = new StateBag();
        PanelStyle myPanelStyle = new PanelStyle(panelState);
        
        // Set the properties of the PanelStyle class.
        myPanelStyle.HorizontalAlign = HorizontalAlign.Center;
        myPanelStyle.ScrollBars = ScrollBars.Both;
        myPanelStyle.Wrap = false;
        myPanelStyle.Direction = ContentDirection.LeftToRight;
        myPanelStyle.BackImageUrl = @"~\images\picture.jpg";

        // Use the ApplyStyle method of the Panel control to apply
        // the settings from the myPanelStyle object.
        Panel1.ApplyStyle(myPanelStyle);
        Panel2.ApplyStyle(myPanelStyle); 
    }
}

この例の 2 番目の部分では、前の例で使用される .aspx ファイル示します

<%@ Page Language="VB" AutoEventWireup="true"
 CodeFile="PanelStyle.vb" Inherits="PanelStylevb_aspx"
 %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html  >
<body>
    <form id="form1" runat="server">
      <h3>PanelStyle Example</h3>
      <asp:Panel id="Panel1" 
        runat="server" 
        width="150" 
        height="50">
        This is the Panel1 panel control.
      </asp:Panel>
      <br /><br />
      <asp:Panel id="Panel2" 
        runat="server" 
        width="150" 
        height="50">
        This is the Panel2 panel control.
      </asp:Panel>
    </form>
  </body>
</html>
<%@ Page Language="C#" CodeFile="PanelStyle.cs" Inherits="PanelStylecs_aspx"
 %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html  >
  <body>
    <form id="form1" runat="server">
      <h3>PanelStyle Example</h3>
      <asp:Panel id="Panel1" 
        runat="server" 
        width="150" 
        height="50">
        This is the Panel1 panel control.
      </asp:Panel>
      <br /><br />
      <asp:Panel id="Panel2" 
        runat="server" 
        width="150" 
        height="50">
        This is the Panel2 panel control.
      </asp:Panel>
    </form>
  </body>
</html>
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Web.UI.WebControls.Style
        System.Web.UI.WebControls.PanelStyle
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PanelStyle メンバ
System.Web.UI.WebControls 名前空間
Style


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

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

辞書ショートカット

すべての辞書の索引

「PanelStyle クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS