BulletStyle Enum
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee geeft u de stijlen voor opsommingstekens op die u kunt toepassen op lijstitems in een BulletedList besturingselement.
public enum class BulletStyle
public enum BulletStyle
type BulletStyle =
Public Enum BulletStyle
- Overname
Velden
| Name | Waarde | Description |
|---|---|---|
| NotSet | 0 | De stijl voor opsommingstekens is niet ingesteld. De browser waarmee het besturingselement wordt weergegeven, bepaalt de stijl van het BulletedList opsommingsteken dat moet worden weergegeven. |
| Numbered | 1 | De stijl opsommingstekens is een getal (1, 2, 3, ...). |
| LowerAlpha | 2 | De stijl van het opsommingsteken is een kleine letter (a, b, c, ...). |
| UpperAlpha | 3 | De stijl opsommingstekens is een hoofdletter (A, B, C, ...). |
| LowerRoman | 4 | De stijl van het opsommingsteken is een Romeins cijfer in kleine letters (i, ii, iii, ...). |
| UpperRoman | 5 | De stijl van het opsommingsteken is een romeinse hoofdletter (I, II, III, ...). |
| Disc | 6 | De stijl opsommingstekens is een gevulde cirkelvorm. |
| Circle | 7 | De stijl opsommingstekens is een lege cirkelvorm. |
| Square | 8 | De stijl van het opsommingsteken is een gevulde vierkante vorm. |
| CustomImage | 9 | De stijl opsommingstekens is een aangepaste afbeelding. |
Voorbeelden
In het volgende voorbeeld ziet u hoe u een BulletedList besturingselement maakt. Een ListBox besturingselement wordt gevuld met alle beschikbare BulletStyle opsommingswaarden. De stijl voor opsommingstekens wordt gewijzigd op basis van de stijl die de gebruiker selecteert in de keuzelijst.
<%@ 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>
Opmerkingen
De BulletStyle opsomming vertegenwoordigt de stijlen voor opsommingstekens die u kunt toepassen op de lijstitems in een BulletedList besturingselement. De BulletStyle eigenschap gebruikt deze opsommingswaarden om de stijlen voor opsommingstekens in een BulletedList besturingselement in te stellen. Als u de BulletStyle eigenschap Discbijvoorbeeld instelt op, geeft elk lijstitem in een BulletedList besturingselement als volgt een gevulde cirkel weer voorafgaand aan de inhoud van het lijstitem:
Lijstitem 1
Lijstitem 2
Lijstitem 3
Als u de CustomImage stijl voor opsommingstekens opgeeft, kunt u uw eigen afbeelding voor het opsommingsteken opgeven. Als u de CustomImage stijl voor opsommingstekens opgeeft, moet u de BulletImageUrl eigenschap ook instellen op de URL van de aangepaste afbeelding die moet worden gebruikt.
Als u opgeeft NotSet, bepaalt de browser waarin het besturingselement wordt weergegeven de stijl van het opsommingsteken dat moet worden weergegeven met de lijstitems in het BulletedList besturingselement.