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

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

RadioButtonList.CreateControlStyle メソッド

すべてのスタイル関連プロパティ実装するために RadioButtonList コントロール内部使用するスタイル オブジェクト作成します

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

解説解説

CreateControlStyle メソッドは、カスタム コントロールRadioButtonList クラスから派生させる場合に、主にコントロール開発者によって使用されます。

使用例使用例

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

<%@ Page Language="VB" AutoEventWireup="True"
 %>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls"
 Assembly="Samples.AspNet.VB"
 %>
<HTML>
    <HEAD><title>Custom RadioButtonList - CreateControlStyle - VB.NET
 Example</title>
    </HEAD>
    <body>
        <form id="Form1" method="post"
 runat="server">
            <h3>Custom RadioButtonList - CreateControlStyle - VB.NET Example</h3>

            <aspSample:CustomRadioButtonListCreateControlStyle 
             id="Radiobuttonlist1" runat="server"
 
             RepeatColumns="2" RepeatDirection="Horizontal">
                <asp:ListItem Value="Item1">Item1</asp:ListItem>
                <asp:ListItem Value="Item2">Item2</asp:ListItem>
                <asp:ListItem Value="Item3">Item3</asp:ListItem>
                <asp:ListItem Value="Item4">Item4</asp:ListItem>
            </aspSample:CustomRadioButtonListCreateControlStyle>
        </form>
    </body>
</HTML>
<br /><span space="preserve">...</span><br
 />Imports System.Web
Imports System.Security.Permissions

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

        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
<%@ Page Language="C#" AutoEventWireup="True" %>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls"
 Assembly="Samples.AspNet.CS" %>
<HTML>
  <HEAD>
    <title>Custom RadioButtonList - CreateControlStyle - C# Example</title>
  </HEAD>
  <body>
    <form id="Form1" method="post" runat="server">
      <h3>Custom RadioButtonList - CreateControlStyle - C# Example</h3>

      <aspSample:CustomRadioButtonListCreateControlStyle 
        id="Radiobuttonlist1" 
        runat="server" 
        RepeatColumns="2" 
        RepeatDirection="Horizontal">
        <asp:ListItem Value="Item1">Item1</asp:ListItem>
        <asp:ListItem Value="Item2">Item2</asp:ListItem>
        <asp:ListItem Value="Item3">Item3</asp:ListItem>
        <asp:ListItem Value="Item4">Item4</asp:ListItem>
      </aspSample:CustomRadioButtonListCreateControlStyle>
      
    </form>
  </body>
</HTML>
<br /><span space="preserve">...</span><br />using
 System.Web;
using System.Security.Permissions;

namespace Samples.AspNet.CS.Controls
{
  [AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)]
  public sealed class CustomRadioButtonListCreateControlStyle
 : System.Web.UI.WebControls.RadioButtonList
  {
    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);
    }
  }
}
<%@ Page Language="VJ#" AutoEventWireup="True" %>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.JSL.Controls"
 Assembly="Samples.AspNet.JSL" %>
<HTML>
  <HEAD>
    <title>Custom RadioButtonList - CreateControlStyle - VJ# Example</title>
  </HEAD>
  <body>
    <form id="Form1" method="post" runat="server">
      <h3>Custom RadioButtonList - CreateControlStyle - VJ# Example</h3>

      <aspSample:CustomRadioButtonListCreateControlStyle 
        id="Radiobuttonlist1" 
        runat="server" 
        RepeatColumns="2" 
        RepeatDirection="Horizontal">
        <asp:ListItem Value="Item1">Item1</asp:ListItem>
        <asp:ListItem Value="Item2">Item2</asp:ListItem>
        <asp:ListItem Value="Item3">Item3</asp:ListItem>
        <asp:ListItem Value="Item4">Item4</asp:ListItem>
      </aspSample:CustomRadioButtonListCreateControlStyle>
      
    </form>
  </body>
</HTML>
<br /><span space="preserve">...</span><br />package
 Samples.AspNet.JSL.Controls; 

public class CustomRadioButtonListCreateControlStyle
    extends System.Web.UI.WebControls.RadioButtonList
{
    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
} //CustomRadioButtonListCreateControlStyle
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS