BulletedList.BulletStyle プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As BulletedList Dim value As BulletStyle value = instance.BulletStyle instance.BulletStyle = value
public: virtual property BulletStyle BulletStyle { BulletStyle get (); void set (BulletStyle value); }
/** @property */ public BulletStyle get_BulletStyle () /** @property */ public void set_BulletStyle (BulletStyle value)
public function get BulletStyle () : BulletStyle public function set BulletStyle (value : BulletStyle)
BulletStyle 値の 1 つ。既定値は NotSet です。


BulletedList コントロールのリスト項目に適用する行頭文字スタイルを指定するには、BulletStyle プロパティを使用します。BulletStyle プロパティは、BulletStyle 列挙値の 1 つを使用して設定します。有効値の一覧を次の表に示します。
NotSet | 設定なし。 |
Numbered | 数値。 |
LowerAlpha | 英小文字。 |
UpperAlpha | 英大文字。 |
LowerRoman | |
UpperRoman | |
黒丸。 | |
白丸。 | |
黒い正方形。 | |
CustomImage |
CustomImage 値を指定すると、行頭文字として任意のイメージを使用できます。CustomImage 値を指定する場合、BulletImageUrl プロパティに、使用するカスタム イメージの URL を設定する必要もあります。

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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からBulletedList.BulletStyle プロパティを検索する場合は、下記のリンクをクリックしてください。

- BulletedList.BulletStyle プロパティのページへのリンク