HtmlInputCheckBox コンストラクタとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HtmlInputCheckBox コンストラクタの意味・解説 

HtmlInputCheckBox コンストラクタ

HtmlInputCheckBox クラス新しインスタンス初期化します。

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

Dim instance As New HtmlInputCheckBox
public HtmlInputCheckBox ()
public:
HtmlInputCheckBox ()
public HtmlInputCheckBox ()
public function HtmlInputCheckBox ()
解説解説
使用例使用例

HtmlInputCheckBox クラス新しインスタンス作成および初期化する方法次のコード例示します

<%@ Page Language="VB" AutoEventWireup="True"
 %>

<html>
<head>

   <script language="VB" runat="server">

       ' Create a new instance of HtmlInputCheckBox.
       Dim cb As New HtmlInputCheckBox()

       ' Create a new instance of Label.
       Dim label As New
 Label()
       
       ' Create a new instance of Button.
       Dim b As New HtmlButton()
       
       Protected Sub Page_Load(ByVal
 sender As Object, ByVal
 e As System.EventArgs)
           
           ' Define attributes of Button and Label.
           b.InnerText = "Click"
           label.Text = "checkbox"
           
           ' Add controls to placeholder
           Container.Controls.Add(cb)
           Container.Controls.Add(label)
           Container.Controls.Add(New LiteralControl("<br>"))
           Container.Controls.Add(b)
           
           ' Add EventHandler
           AddHandler b.ServerClick, AddressOf
 button_ServerClick
          
       End Sub
       
       Sub button_ServerClick(ByVal sender
 As Object, ByVal e As
 EventArgs)
           Select Case cb.Checked
               Case True
                   Message.InnerHtml = "Checkbox is checked."
        
               Case Else
                   Message.InnerHtml = "Checkbox is not checked."
           End Select

       End Sub

</script>

</head>

<body>

   <h3>HtmlInputCheckBox Constructor Sample</h3>

   <form id="Form1" runat="server">

      <asp:PlaceHolder id="Container" runat="server"></asp:PlaceHolder>
    
       
      <br />
      <span id="Message" 
            style="color:red" 
            runat="server"/>

   </form>

</body>
</html>
   
<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
<head>

   <script language="C#" runat="server">
       
       
       // Create a new instance of HtmlInputCheckBox.
       HtmlInputCheckBox cb = new HtmlInputCheckBox();

       // Create a new instance of Label.
       Label label = new Label();
       
       // Create a new instance of Button.
       HtmlButton b = new HtmlButton();

       protected void Page_Load(object sender,
 EventArgs e)
       {
           // Define attributes of Button and Label.
           b.InnerText = "Click";
           label.Text = "checkbox";
           
           // Add controls to placeholder
           Container.Controls.Add(cb);
           Container.Controls.Add(label);
           Container.Controls.Add(new LiteralControl("<br>"));
           Container.Controls.Add(b);
           
           // Add EventHandler
           b.ServerClick += new EventHandler(button_ServerClick);

       }
       
       void button_ServerClick(object sender, EventArgs e)
       {
           switch (cb.Checked)
           {
               case true:
                   Message.InnerHtml = "Checkbox is checked.";
                   break;

               default:
                   Message.InnerHtml = "Checkbox is not checked.";
                   break;
           }
       }
</script>

</head>

<body>

   <h3>HtmlInputCheckBox Constructor Sample</h3>

   <form runat="server">

      <asp:PlaceHolder id="Container" runat="server"></asp:PlaceHolder>
    
       
      <br />
      <span id="Message" 
            style="color:red" 
            runat="server"/>

   </form>

</body>
</html>
   
void Page_Load(Object sender, EventArgs e)
{
    HtmlInputCheckBox checkBox = new HtmlInputCheckBox();
} //Page_Load
function Page_Load(sender : Object, e : EventArgs){
    var checkBox : HtmlInputCheckBox = new
 HtmlInputCheckBox()
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「HtmlInputCheckBox コンストラクタ」の関連用語

HtmlInputCheckBox コンストラクタのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS