TableCell.CreateControlStyle メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TableCell.CreateControlStyle メソッドの意味・解説 

TableCell.CreateControlStyle メソッド

TableCell コントロールの TableItemStyle を作成します

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

Protected Overrides Function
 CreateControlStyle As Style
Dim returnValue As Style

returnValue = Me.CreateControlStyle
protected override Style CreateControlStyle ()
protected:
virtual Style^ CreateControlStyle () override
protected Style CreateControlStyle ()
protected override function CreateControlStyle
 () : Style

戻り値
TableCell コントロールTableItemStyle を表す Style

解説解説

CreateControlStyle メソッド作成される TableItemStyle は、Wrap プロパティ、HorizontalAlign プロパティ、および VerticalAlign プロパティ使用されます。

CreateControlStyle メソッドは、主に、コントロール開発者TableCell コントロール機能拡張する際に使用します

使用例使用例

カスタム サーバー コントロールCreateControlStyle メソッドオーバーライドし、TableCell の TableStyle クラスについて、常に新しインスタンス返されるようにする方法コード例次に示します

<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls"
 Assembly="Samples.AspNet.VB"
 %>
<%@ Page Language="VB" AutoEventWireup="True"
 %>
<HTML>
    <HEAD>
        <title>Custom TableCell - CreateControlStyle - VB.NET Example</title>
    </HEAD>
    <body>
        <form id="Form1" method="post"
 runat="server">
            <h3>Custom TableCell - CreateControlStyle - VB.NET Example</h3>
            
            <asp:Table id="Table1" runat="server"
 CellPadding="3" CellSpacing="2">
                <asp:TableRow>
                    <aspSample:CustomTableCellCreateControlStyle Text="(0,0)"
 />
                    <aspSample:CustomTableCellCreateControlStyle Text="(0,1)"
 />
                    <aspSample:CustomTableCellCreateControlStyle Text="(0,2)"
 />
                </asp:TableRow>
                <asp:TableRow>
                    <aspSample:CustomTableCellCreateControlStyle Text="(1,0)"
 />
                    <aspSample:CustomTableCellCreateControlStyle Text="(1,1)"
 />
                    <aspSample:CustomTableCellCreateControlStyle Text="(1,2)"
 />
                </asp:TableRow>
            </asp:Table>
        </form>
    </body>
</HTML>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls"
 Assembly="Samples.AspNet.CS" %>
<%@ Page Language="C#" AutoEventWireup="True" %>
<HTML>
    <HEAD>
        <title>Custom TableCell - CreateControlStyle - C# Example</title>
  </HEAD>
    <body>
        <form id="Form1" method="post" runat="server">
            <h3>Custom TableCell - CreateControlStyle - C# Example</h3>
      
      <asp:Table id="Table1" 
        runat="server" 
        CellPadding="3" 
        CellSpacing="2">
        <asp:TableRow>
          <aspSample:CustomTableCellCreateControlStyle Text="(0,0)"
 />
          <aspSample:CustomTableCellCreateControlStyle Text="(0,1)"
 />
          <aspSample:CustomTableCellCreateControlStyle Text="(0,2)"
 />
        </asp:TableRow>
        <asp:TableRow>
          <aspSample:CustomTableCellCreateControlStyle Text="(1,0)"
 />
          <aspSample:CustomTableCellCreateControlStyle Text="(1,1)"
 />
          <aspSample:CustomTableCellCreateControlStyle Text="(1,2)"
 />
        </asp:TableRow>
      </asp:Table>
      
        </form>
    </body>
</HTML>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.JSL.Controls"
 Assembly="Samples.AspNet.JSL" %>
<%@ Page Language="VJ#" AutoEventWireup="True" %>
<HTML>
    <HEAD>
        <title>Custom TableCell - CreateControlStyle - VJ# Example</title>
  </HEAD>
    <body>
        <form id="Form1" method="post" runat="server">
            <h3>Custom TableCell - CreateControlStyle - VJ# Example</h3>
      
      <asp:Table id="Table1" 
        runat="server" 
        CellPadding="3" 
        CellSpacing="2">
        <asp:TableRow>
          <aspSample:CustomTableCellCreateControlStyle Text="(0,0)"
 />
          <aspSample:CustomTableCellCreateControlStyle Text="(0,1)"
 />
          <aspSample:CustomTableCellCreateControlStyle Text="(0,2)"
 />
        </asp:TableRow>
        <asp:TableRow>
          <aspSample:CustomTableCellCreateControlStyle Text="(1,0)"
 />
          <aspSample:CustomTableCellCreateControlStyle Text="(1,1)"
 />
          <aspSample:CustomTableCellCreateControlStyle Text="(1,2)"
 />
        </asp:TableRow>
      </asp:Table>
      
        </form>
    </body>
</HTML>
Imports System.Web
Imports System.Security.Permissions

Namespace Samples.AspNet.VB.Controls
    <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)>
 _
    Public NotInheritable Class
 CustomTableCellCreateControlStyle
        Inherits System.Web.UI.WebControls.TableCell

        Protected Overrides Function
 CreateControlStyle() As System.Web.UI.WebControls.Style

            ' Initializes and return a new instance of the TableStyle
 class.
            Return New System.Web.UI.WebControls.TableStyle(Me.ViewState)
        End Function
    End Class
End Namespace
using System.Web;
using System.Security.Permissions;

namespace Samples.AspNet.CS.Controls
{
  [AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)]
  public sealed class CustomTableCellCreateControlStyle
 : System.Web.UI.WebControls.TableCell
  {
    protected override System.Web.UI.WebControls.Style CreateControlStyle()
    {
      // Initializes and return a new instance of the TableStyle class.
      return new System.Web.UI.WebControls.TableStyle(this.ViewState);
    }
  }
}
package Samples.AspNet.JSL.Controls; 

public class CustomTableCellCreateControlStyle
    extends System.Web.UI.WebControls.TableCell
{
    protected System.Web.UI.WebControls.Style CreateControlStyle()
    {
        // Initializes and return a new instance of the TableStyle class.
        return new System.Web.UI.WebControls.TableStyle(this.get_ViewState());
    } //CreateControlStyle
} //CustomTableCellCreateControlStyle
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TableCell クラス
TableCell メンバ
System.Web.UI.WebControls 名前空間
Style クラス
TableItemStyle
Wrap
HorizontalAlign
VerticalAlign
その他の技術情報
Table、TableRow、TableCell の各 Web サーバー コントロール



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

辞書ショートカット

すべての辞書の索引

TableCell.CreateControlStyle メソッドのお隣キーワード
検索ランキング

   

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



TableCell.CreateControlStyle メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS