Share via


Calendar.CaptionAlign プロパティ

定義

カレンダーのキャプションとして表示するテキストの配置を取得または設定します。

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

プロパティ値

TableCaptionAlign

キャプションの配置を示す TableCaptionAlign 値。

例外

指定された値が TableCaptionAlign 値ではありません。

次のコード例は、プロパティを使用してコントロールの CaptionAlign キャプションを配置する方法を 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>

注釈

このプロパティは、コントロールに関連してキャプションが表示される場所を Calendar 決定します。 既定値は、 NotSetブラウザーがキャプションを配置する場所を決定できるようにします。 次の表では、値とキャプションの TableCaptionAlign 外観の関係について説明します。

TableCaptionAlign 外観
Bottom キャプションがカレンダーの下部に表示され、テキストが中央に配置されます。
Left キャプションはカレンダーの上部に表示され、テキストは左揃えで表示されます。
NotSet キャプションの配置は設定されておらず、ブラウザーによって決定されます。
Right キャプションがカレンダーの上部に表示され、テキストが右揃えになります。
Top キャプションは、テキストが中央揃えの予定表の上部に表示されます。

適用対象

こちらもご覧ください