BulletStyle 列挙体とは? わかりやすく解説

BulletStyle 列挙体

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

BulletedList コントロールリスト項目に適用できる箇条書きスタイル指定します

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

public enum BulletStyle
public enum class BulletStyle
public enum BulletStyle
public enum BulletStyle
メンバメンバ
 メンバ説明
Circle箇条書きスタイルは、塗りつぶしのない円です。 
CustomImage箇条書きスタイルは、カスタム イメージです。 
Disc箇条書きスタイルは、塗りつぶされた円です。 
LowerAlpha箇条書きスタイルは、小文字文字 (a、b、c ...) です。 
LowerRoman箇条書きスタイルは、小文字ローマ数字 (i、iiiii ...) です。 
NotSet箇条書きスタイル設定されていません。BulletedList コントロール表示するブラウザによって、表示する箇条書きスタイル決まります。 
Numbered箇条書きスタイルは、番号 (1、2、3 ...) です。 
Square箇条書きスタイルは、塗りつぶされ四角形です。 
UpperAlpha箇条書きスタイルは、大文字文字 (A、B、C ...) です。 
UpperRoman箇条書きスタイルは、大文字ローマ数字 (I、IIIII ...) です。 
解説解説
使用例使用例

BulletedList コントロール作成する方法次の例に示しますListBox コントロールに、使用できるすべての BulletStyle 列挙値が設定されます。ユーザーリスト ボックスから選択したスタイルに応じて箇条書きスタイル変わります

<%@ Page Language="VB" %>

<html>
<head>

    <script runat="server">       
        Sub Index_Changed(ByVal sender As
 Object, ByVal e As System.EventArgs)
            ' Change the message displayed, based on 
            ' the style selected from the list box.
            If BulletStylesListBox.SelectedIndex > -1 Then
                Message.Text = "You selected bullet style: "
 & BulletStylesListBox.SelectedItem.Text
            End If

            ' Change the bullet style used, based on 
            ' the style selected from the list box.
            Select Case (BulletStylesListBox.SelectedIndex)
                Case 0
                    ItemsBulletedList.BulletStyle = BulletStyle.Numbered
                Case 1
                    ItemsBulletedList.BulletStyle = BulletStyle.LowerAlpha
                Case 2
                    ItemsBulletedList.BulletStyle = BulletStyle.UpperAlpha
                Case 3
                    ItemsBulletedList.BulletStyle = BulletStyle.LowerRoman
                Case 4
                    ItemsBulletedList.BulletStyle = BulletStyle.UpperRoman
                Case 5
                    ItemsBulletedList.BulletStyle = BulletStyle.Disc
                Case 6
                    ItemsBulletedList.BulletStyle = BulletStyle.Circle
                Case 7
                    ItemsBulletedList.BulletStyle = BulletStyle.Square
                Case 8
                    ItemsBulletedList.BulletStyle = BulletStyle.CustomImage
                    ' Specify the path to the custom image to use for
 the bullet.
                    ItemsBulletedList.BulletImageUrl = "Images/image1.jpg"
                Case 9
                    Message.Text = "You selected NotSet. The browser
 will determine the bullet style."
                Case Else
                    Throw New Exception("You
 did not select a valid bullet style.")
            End Select

        End Sub

</script>

</head>
<body>
    <form ID="Form1" runat="server">
 

        <h3>BulletStyle Example</h3>

        <asp:BulletedList id="ItemsBulletedList"
             
            DisplayMode="Text" 
            BulletStyle=NotSet
            runat="server">    
                <asp:ListItem Value="0">Coho
 Winery</asp:ListItem>
                <asp:ListItem Value="1">Contoso,
 Ltd.</asp:ListItem>
                <asp:ListItem Value="2">Tailspin
 Toys</asp:ListItem>
            </asp:BulletedList>        

            <hr>

        <h4>Select a bullet type:</h4>        
        <asp:ListBox id="BulletStylesListBox" 
            SelectionMode="Single"
            Rows=1 
            OnSelectedIndexChanged="Index_Changed"
            AutoPostBack="True"
            runat="server">         
                <asp:ListItem Value="Numbered">Numbered</asp:ListItem>
                <asp:ListItem Value="LowerAlpha">LowerAlpha</asp:ListItem>
                <asp:ListItem Value="UpperAlpha">UpperAlpha</asp:ListItem>
                <asp:ListItem Value="LowerRoman">LowerRoman</asp:ListItem>
                <asp:ListItem Value="UpperRoman">UpperRoman</asp:ListItem>
                <asp:ListItem>Disc</asp:ListItem>
                <asp:ListItem>Circle</asp:ListItem>
                <asp:ListItem>Square</asp:ListItem>
                <asp:ListItem>CustomImage</asp:ListItem>       
                <asp:ListItem Value="NotSet">NotSet</asp:ListItem>
        </asp:ListBox>        
            
        <hr>

        <asp:Label id="Message" 
            runat="server"/>            
                  
   </form>
</body>
</html>
<%@ Page Language="C#" %>

<html>
<head>

    <script runat="server">       
        protected void Index_Changed(object
 sender, EventArgs e)
        {
            // Change the message displayed, based on 
            // the style selected from the list box.
            if (BulletStylesListBox.SelectedIndex > -1)
            {
                Message.Text = "You selected bullet style: " +
                    BulletStylesListBox.SelectedItem.Text;
            }

            // Change the bullet style used, based on 
            // the style selected from the list box.
            switch (BulletStylesListBox.SelectedIndex)
            {
                case 0:
                    ItemsBulletedList.BulletStyle = BulletStyle.Numbered;
                    break;
                case 1:
                    ItemsBulletedList.BulletStyle = BulletStyle.LowerAlpha;
                    break;
                case 2:
                    ItemsBulletedList.BulletStyle = BulletStyle.UpperAlpha;
                    break;
                case 3:
                    ItemsBulletedList.BulletStyle = BulletStyle.LowerRoman;
                    break;
                case 4:
                    ItemsBulletedList.BulletStyle = BulletStyle.UpperRoman;
                    break;
                case 5:
                    ItemsBulletedList.BulletStyle = BulletStyle.Disc;
                    break;
                case 6:
                    ItemsBulletedList.BulletStyle = BulletStyle.Circle;
                    break;
                case 7:
                    ItemsBulletedList.BulletStyle = BulletStyle.Square;
                    break;
                case 8:
                    ItemsBulletedList.BulletStyle = BulletStyle.CustomImage;
                    // Specify the path to the custom image to use for
 the bullet.
                    ItemsBulletedList.BulletImageUrl = "Images/image1.jpg";
                    break;
                case 9:
                    Message.Text = "You selected NotSet. The browser will determine
 the bullet style.";
                    break;
                default:
                    throw new Exception("You did not select
 a valid bullet style.");
            }

        }
</script>

</head>
<body>
    <form id="Form1" runat="server">
        <h3>
            BulletStyle Example</h3>
        <asp:BulletedList ID="ItemsBulletedList" DisplayMode="Text"
 BulletStyle="NotSet"
            runat="server">
            <asp:ListItem Value="0">Coho Winery</asp:ListItem>
            <asp:ListItem Value="1">Contoso, Ltd.</asp:ListItem>
            <asp:ListItem Value="2">Tailspin Toys</asp:ListItem>
        </asp:BulletedList>
        <hr>
        <h4>
            Select a bullet type:</h4>
        <asp:ListBox ID="BulletStylesListBox" SelectionMode="Single"
 Rows="1" OnSelectedIndexChanged="Index_Changed"
            AutoPostBack="True" runat="server">
            <asp:ListItem Value="Numbered">Numbered</asp:ListItem>
            <asp:ListItem Value="LowerAlpha">LowerAlpha</asp:ListItem>
            <asp:ListItem Value="UpperAlpha">UpperAlpha</asp:ListItem>
            <asp:ListItem Value="LowerRoman">LowerRoman</asp:ListItem>
            <asp:ListItem Value="UpperRoman">UpperRoman</asp:ListItem>
            <asp:ListItem>Disc</asp:ListItem>
            <asp:ListItem>Circle</asp:ListItem>
            <asp:ListItem>Square</asp:ListItem>
            <asp:ListItem>CustomImage</asp:ListItem>
            <asp:ListItem Value="NotSet">NotSet</asp:ListItem>
        </asp:ListBox>
        <hr>
        <asp:Label ID="Message" runat="server" />
    </form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Web.UI.WebControls 名前空間
BulletedList クラス
BulletedList.BulletStyle プロパティ
BulletedList.BulletImageUrl プロパティ
その他の技術情報
BulletedList Web サーバー コントロール



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

辞書ショートカット

すべての辞書の索引

「BulletStyle 列挙体」の関連用語

BulletStyle 列挙体のお隣キーワード
検索ランキング

   

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



BulletStyle 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS