This documentation is archived and is not being maintained.

Calendar.ShowTitle Property

Gets or sets a value indicating whether the title section is displayed.

[Visual Basic]
Public Property ShowTitle As Boolean
[C#]
public bool ShowTitle {get; set;}
[C++]
public: __property bool get_ShowTitle();
public: __property void set_ShowTitle(bool);
[JScript]
public function get ShowTitle() : Boolean;
public function set ShowTitle(Boolean);

Property Value

true if the Calendar control displays the title section; otherwise, false. The default value is true.

Remarks

Use the ShowTitle property to specify whether the title section is displayed.

Note   Hiding the title section also hides the next and previous month navigation controls.

The appearance of the title section can be customized by using the TitleStyle property.

Example

[Visual Basic, C#] The following example demonstrates how to use the ShowTitle property to hide the title header.

[Visual Basic] 
<%@ Page Language="VB" AutoEventWireup="True" %>

<html>
   <script runat="server" >
  
      Sub Check_Change(sender As Object, e As EventArgs)
   
         ' Show or hide the title section of the Calendar control
         ' depending on the state of the ShowTitleCheckBox CheckBox
         ' control.
         If ShowTitleCheckBox.Checked Then

            Calendar1.ShowTitle = True

         Else

            Calendar1.ShowTitle = False

         End If

      End Sub
  
   </script>
  
<body>

   <form runat="server">
  
      <h3> Calendar ShowTitle Example </h3>

      Select whether to show or hide the title section.

      <br><br> 
  
      <asp:Calendar id="Calendar1" 
           ShowTitle="True"
           runat="server"/>

      <br><br>

      <asp:CheckBox id="ShowTitleCheckBox"
           Text="Show/Hide title section"
           AutoPostBack="True"
           Checked="True"
           OnCheckedChanged="Check_Change"
           runat="server"/>
  
   </form>

</body>
</html>
 

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

<html>
   <script runat="server" >
  
      void Check_Change(Object sender, EventArgs e)
      {
   
         // Show or hide the title section of the Calendar control
         // depending on the state of the ShowTitleCheckBox CheckBox
         // control.
         if (ShowTitleCheckBox.Checked)
         {

            Calendar1.ShowTitle = true;

         }
         else
         {

            Calendar1.ShowTitle = false;

         }

      }
  
   </script>
  
<body>

   <form runat="server">
  
      <h3> Calendar ShowTitle Example </h3>

      Select whether to show or hide the title section.

      <br><br> 
  
      <asp:Calendar id="Calendar1" 
           ShowTitle="True"
           runat="server"/>

      <br><br>

      <asp:CheckBox id="ShowTitleCheckBox"
           Text="Show/Hide title section"
           AutoPostBack="True"
           Checked="True"
           OnCheckedChanged="Check_Change"
           runat="server"/>
  
   </form>

</body>
</html>
 

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

Calendar Class | Calendar Members | System.Web.UI.WebControls Namespace | TitleStyle

Show: