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

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

RadioButton.GroupName プロパティ

オプション ボタン属すグループの名前を取得または設定します

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

<ThemeableAttribute(False)> _
Public Overridable Property
 GroupName As String
Dim instance As RadioButton
Dim value As String

value = instance.GroupName

instance.GroupName = value
[ThemeableAttribute(false)] 
public virtual string GroupName { get;
 set; }
[ThemeableAttribute(false)] 
public:
virtual property String^ GroupName {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_GroupName ()

/** @property */
public void set_GroupName (String value)

プロパティ
オプション ボタン属すグループの名前。既定値空の文字列 ("") です。

解説解説
使用例使用例

GroupName プロパティプログラムによって設定する方法次のコード例示します

<%@ Page Language="VB" AutoEventWireup="True"
 %>
<html>
 <head>
    <script language="VB" runat="server">
 
    Sub Button1_Click(sender As Object,
 e As EventArgs)
        If Radio3.GroupName = "RegularMenu"
 Then
            Radio3.GroupName = "VegitarianMenu"
            Radio3.BackColor = System.Drawing.Color.LightGreen
        Else
            Radio3.GroupName = "RegularMenu"
            Radio3.BackColor = System.Drawing.Color.Pink
        End If
    End Sub
 
    </script>
 </head>
 <body>
 
     <h3>Panel Example</h3>
 
     <form runat=server>
 
        <asp:Label id="Label1" BackColor="Pink"
 Text="RegularMenu" runat="server"/>
        &nbsp;
 
        <asp:Label id="Label2" BackColor="LightGreen"
 Text="VegitarianMenu" runat="server"/>
        <p>
 
        <asp:RadioButton id="Radio1" GroupName="RegularMenu"
             Text="Beef" BackColor="Pink"
 runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio2" GroupName="RegularMenu"
             Text="Pork" BackColor="Pink"
 runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio3" GroupName="RegularMenu"
             Text="Fish" BackColor="Pink"
 runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio4" GroupName="VegitarianMenu"
             Text="Mushroom" BackColor="LightGreen"
 runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio5" GroupName="VegitarianMenu"
             Text="Tofu" BackColor="LightGreen"
 runat="server"/>
 
        <p>
        <asp:Button id="Button1" OnClick="Button1_Click"
             Text="Regroup the radio buttons" runat="server"/>
 
    </form>
 
 </body>
 </html>
 
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
 <head>
    <script language="C#" runat="server">
 
       void Button1_Click(Object sender, EventArgs e) {
          if (Radio3.GroupName == "RegularMenu") {
             Radio3.GroupName = "VegitarianMenu";
             Radio3.BackColor = System.Drawing.Color.LightGreen;
          } 
          else {
            Radio3.GroupName = "RegularMenu";
            Radio3.BackColor = System.Drawing.Color.Pink;
          }
       }    
 
    </script>
 </head>
 <body>
 
     <h3>Panel Example</h3>
 
     <form runat=server>
 
        <asp:Label id="Label1" BackColor="Pink" Text="RegularMenu"
 runat="server"/>
        &nbsp;
 
        <asp:Label id="Label2" BackColor="LightGreen" Text="VegitarianMenu"
 runat="server"/>
        <p>
 
        <asp:RadioButton id="Radio1" GroupName="RegularMenu"
             Text="Beef" BackColor="Pink" runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio2" GroupName="RegularMenu"
             Text="Pork" BackColor="Pink" runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio3" GroupName="RegularMenu"
             Text="Fish" BackColor="Pink" runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio4" GroupName="VegitarianMenu"
             Text="Mushroom" BackColor="LightGreen" runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio5" GroupName="VegitarianMenu"
             Text="Tofu" BackColor="LightGreen" runat="server"/>
 
        <p>
        <asp:Button id="Button1" OnClick="Button1_Click"
             Text="Regroup the radio buttons" runat="server"/>
 
    </form>
 
 </body>
 </html>
 
<%@ Page Language="JScript" AutoEventWireup="True" %>
<html>
 <head>
    <script language="JScript" runat="server">
 
       function Button1_Click(sender, e : EventArgs) {
          if (Radio3.GroupName == "RegularMenu") {
             Radio3.GroupName = "VegitarianMenu";
             Radio3.BackColor = System.Drawing.Color.LightGreen;
          } 
          else {
            Radio3.GroupName = "RegularMenu";
            Radio3.BackColor = System.Drawing.Color.Pink;
          }
       }    
 
    </script>
 </head>
 <body>
 
     <h3>Panel Example</h3>
 
     <form runat=server>
 
        <asp:Label id="Label1" BackColor="Pink" Text="RegularMenu"
 runat="server"/>
        &nbsp;
 
        <asp:Label id="Label2" BackColor="LightGreen" Text="VegitarianMenu"
 runat="server"/>
        <p>
 
        <asp:RadioButton id="Radio1" GroupName="RegularMenu"
             Text="Beef" BackColor="Pink" runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio2" GroupName="RegularMenu"
             Text="Pork" BackColor="Pink" runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio3" GroupName="RegularMenu"
             Text="Fish" BackColor="Pink" runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio4" GroupName="VegitarianMenu"
             Text="Mushroom" BackColor="LightGreen" runat="server"/>
 
        <p>
        <asp:RadioButton id="Radio5" GroupName="VegitarianMenu"
             Text="Tofu" BackColor="LightGreen" runat="server"/>
 
        <p>
        <asp:Button id="Button1" OnClick="Button1_Click"
             Text="Regroup the radio buttons" runat="server"/>
 
    </form>
 
 </body>
 </html>
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS