BulletStyle 열거형

정의

BulletedList 컨트롤에서 목록 항목에 적용할 수 있는 글머리 기호 스타일을 지정합니다.

public enum class BulletStyle
public enum BulletStyle
type BulletStyle = 
Public Enum BulletStyle
상속
BulletStyle

필드

Circle 7

글머리 기호 스타일이 빈 원 모양입니다.

CustomImage 9

글머리 기호 스타일이 사용자 지정 이미지입니다.

Disc 6

글머리 기호 스타일이 채워진 원 모양입니다.

LowerAlpha 2

글머리 기호 스타일이 영어 소문자(a, b, c 등)입니다.

LowerRoman 4

글머리 기호 스타일이 소문자로 된 로마 숫자(i, ii, iii 등)입니다.

NotSet 0

글머리 기호 스타일이 설정되지 않습니다. BulletedList 컨트롤을 렌더링하는 브라우저에서 표시할 글머리 기호 스타일이 자동으로 결정됩니다.

Numbered 1

글머리 기호 스타일이 숫자(1, 2, 3 등)입니다.

Square 8

글머리 기호 스타일이 채워진 사각형 모양입니다.

UpperAlpha 3

글머리 기호 스타일이 영어 대문자(A, B, C 등)입니다.

UpperRoman 5

글머리 기호 스타일이 대문자로 된 로마 숫자(I, II, III 등)입니다.

예제

다음 예제에서는 만드는 방법을 보여 줍니다는 BulletedList 제어 합니다. A ListBox 컨트롤 모두 채워집니다 사용할 BulletStyle 열거형 값입니다. 사용자가 목록 상자에서 선택한 스타일에 따라 글머리 기호 스타일이 변경 됩니다.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>
            BulletStyle Example</title>
<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" AssociatedControlID="BulletStylesListBox" />
    </form>
</body>
</html>
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>BulletStyle Example</title>
<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"
            AssociatedControlID="BulletStylesListBox"/>            
                  
   </form>
</body>
</html>

설명

합니다 BulletStyle 열거형에서 목록 항목에 적용할 수 있는 글머리 기호 스타일을 나타냅니다는 BulletedList 제어 합니다. 합니다 BulletStyle 에서 글머리 기호 스타일을 설정 하려면 이러한 열거형 값을 사용 하는 속성을 BulletedList 제어 합니다. 예를 들어, 설정 하는 경우는 BulletStyle 속성을 Disc, 각 목록 항목에는 BulletedList 컨트롤 속이 찬된 원 같이 앞에 오는 목록 항목의 콘텐츠를 렌더링 합니다:

  • List Item 1

  • List Item 2

  • List Item 3

지정 된 CustomImage 글머리 기호 스타일을 사용 하면 글머리 기호에 대 한 사용자 고유의 이미지를 제공할 수 있습니다. 지정 하는 경우는 CustomImage 글머리 기호 스타일을 설정 해야 합니다 BulletImageUrl 속성을 사용 하 여 사용자 지정 이미지의 URL입니다.

지정 하는 경우 NotSet, 컨트롤을 렌더링 하는 브라우저에서 목록 항목을 사용 하 여 표시할 글머리 기호 스타일이 결정는 BulletedList 컨트롤입니다.

적용 대상

추가 정보