Calendar.CaptionAlign Właściwość

Definicja

Pobiera lub ustawia wyrównanie tekstu renderowanego jako podpis kalendarza.

public:
 virtual property System::Web::UI::WebControls::TableCaptionAlign CaptionAlign { System::Web::UI::WebControls::TableCaptionAlign get(); void set(System::Web::UI::WebControls::TableCaptionAlign value); };
public virtual System.Web.UI.WebControls.TableCaptionAlign CaptionAlign { get; set; }
member this.CaptionAlign : System.Web.UI.WebControls.TableCaptionAlign with get, set
Public Overridable Property CaptionAlign As TableCaptionAlign

Wartość właściwości

TableCaptionAlign Wartość wskazująca wyrównanie podpisu.

Wyjątki

Określona wartość nie jest jedną z TableCaptionAlign wartości.

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą CaptionAlign właściwości wyrównać podpis dla kontrolki Calendar .

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

<!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> Calendar Caption and Caption Align Example </title>
</head>
<body>

   <form id="form1" runat="server">
  
      <h3> Calendar Caption and Caption Align Example </h3>

      <br /><br /> 
  
      <asp:Calendar id="Calendar1"
           ShowGridLines="True" 
           ShowTitle="True"
            Caption="This calendar is used to demonstrate a calendar caption. It also shows
            how the caption can be aligned to the calendar, in this case to the right edge of
            the calendar."
            CaptionAlign="right"  
           runat="server"/>

      <br /><br />

   </form>

</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>

<!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> Calendar Caption and Caption Align Example </title>
</head>
<body>

   <form id="form1" runat="server">
  
      <h3> Calendar Caption and Caption Align Example </h3>

      <br /><br /> 
  
      <asp:Calendar id="Calendar1"
           ShowGridLines="True" 
           ShowTitle="True"
            Caption="This calendar is used to demonstrate a calendar caption. It also shows
            how the caption can be aligned to the calendar, in this case to the right edge of
            the calendar."
            CaptionAlign="right"  
           runat="server"/>

      <br /><br />

   </form>

</body>
</html>

Uwagi

Ta właściwość określa, gdzie pojawia się podpis w odniesieniu do kontrolki Calendar . Wartość domyślna to NotSet, która umożliwia przeglądarce określenie, gdzie ma być wyrównany podpis. W poniższej tabeli wyjaśniono relację między TableCaptionAlign wartością a wyglądem podpisu.

TableCaptionAlign Wartość Wygląd
Bottom Podpis pojawia się w dolnej części kalendarza z tekstem wyśrodkowany.
Left Podpis pojawia się w górnej części kalendarza z tekstem wyrównanym po lewej stronie.
NotSet Wyrównanie podpisu nie jest ustawione i jest określane przez przeglądarkę.
Right Podpis pojawia się w górnej części kalendarza z tekstem wyrównanym do prawej.
Top Podpis pojawia się w górnej części kalendarza z tekstem wyśrodkowany.

Dotyczy

Zobacz też