Calendar.Caption Właściwość

Definicja

Pobiera lub ustawia wartość tekstową renderowaną jako podpis kalendarza.

public:
 virtual property System::String ^ Caption { System::String ^ get(); void set(System::String ^ value); };
public virtual string Caption { get; set; }
member this.Caption : string with get, set
Public Overridable Property Caption As String

Wartość właściwości

String

Podpis tabeli.

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą Caption właściwości wyświetlić podpis 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

Podpis tabeli służy do opisywania charakteru tabeli w jednym do trzech zdań. Użyj właściwości , CaptionAlign aby wyrównać podpis do kalendarza.

Wartość tej właściwości, po ustawieniu, można zapisać automatycznie w pliku zasobów przy użyciu narzędzia projektanta. Aby uzyskać więcej informacji, zobacz LocalizableAttribute i ASP.NET globalizacji i lokalizacji.

Dotyczy

Zobacz też