CalendarDayとは? わかりやすく解説

CalendarDay クラス

Calendar コントロールの日付を表します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

public class CalendarDay
public ref class CalendarDay
public class CalendarDay
public class CalendarDay
解説解説
使用例使用例

CalendarDay オブジェクトのプロパティを使用して、DayRender イベントで表示される日付が表示された月内の日付であり、土曜日や日曜日でないことを確認する方法を次の例に示します。これらの日付は黄色で表示されます。DayRender イベント ハンドラに渡される DayRenderEventArgs オブジェクトの Day プロパティは、CalendarDay オブジェクトです。

<%@ Page Language="VB" AutoEventWireup="True"
 %>

<html>
<head>

   <script language="VB" runat="server">
        Sub DayRender(source As Object,
 e As DayRenderEventArgs)
            
            If Not e.Day.IsOtherMonth And
 Not e.Day.IsWeekend Then
                e.Cell.BackColor = System.Drawing.Color.Yellow
            End If 
        End Sub 'DayRender
   </script>
 
</head>
 
<body>
 
   <form runat="server">
 
      <asp:Calendar id="calendar1" runat="server"
           WeekendDayStyle-BackColor="gray"
           OnDayRender="DayRender"/>
                   
   </form>
         
</body>
</html>
   
<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
<head>

   <script language="C#" runat="server">

      void DayRender(Object source, DayRenderEventArgs e) 
      {
      
         if (!e.Day.IsOtherMonth && !e.Day.IsWeekend)
            e.Cell.BackColor=System.Drawing.Color.Yellow;
      
      }

   </script>
 
</head>
 
<body>
 
   <form runat="server">
 
      <asp:Calendar id="calendar1" runat="server"
           WeekendDayStyle-BackColor="gray"
           OnDayRender="DayRender"/>
                   
   </form>
         
</body>
</html>
   
<%@ Page Language="JScript" AutoEventWireup="True" %>

<html>
<head>

   <script language="JScript" runat="server">

      function DayRender(source : Object, e : DayRenderEventArgs)
 
      {
      
         if (!e.Day.IsOtherMonth && !e.Day.IsWeekend)
            e.Cell.BackColor=System.Drawing.Color.Yellow;
      
      }

   </script>
 
</head>
 
<body>
 
   <form runat="server">
 
      <asp:Calendar id="calendar1" runat="server"
           WeekendDayStyle-BackColor="gray"
           OnDayRender="DayRender"/>
                   
   </form>
         
</body>
</html>
   
<%@ Page Language="VB" AutoEventWireup="True"
 %>
<html>
<head>

   <script runat="server">
   
      Sub DayRender(sender as Object,
 e As DayRenderEventArgs) 

         ' Change the background color of the days in the month
         ' to yellow.
         If (Not e.Day.IsOtherMonth) And
 (Not e.Day.IsWeekend) Then
        
            e.Cell.BackColor=System.Drawing.Color.Yellow
         
         End If

         ' Add custom text to cell in the Calendar control.
         If e.Day.Date.Day = 18 Then
         
            e.Cell.Controls.Add(New LiteralControl("<br>Holiday"))
         
         End If

      End Sub

      Sub Page_Load(sender As Object,
 e As EventArgs)

         ' Manually register the event-handling method for the DayRender
  
         ' event of the Calendar control.
         AddHandler Calendar1.DayRender, AddressOf
 DayRender

      End Sub

   </script>
 
</head>
 
<body>
 
   <form runat="server">

      <h3>Calendar DayRender Example</h3>
 
      <asp:Calendar id="Calendar1" 
                    runat="server">

         <WeekendDayStyle BackColor="gray">
         </WeekendDayStyle>

      </asp:Calendar>
                   
   </form>
          
</body>
</html>
   
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>

   <script runat="server">
   
      void DayRender(Object sender, DayRenderEventArgs e) 
      {

         // Change the background color of the days in the month
         // to yellow.
         if (!e.Day.IsOtherMonth && !e.Day.IsWeekend)
         {
            e.Cell.BackColor=System.Drawing.Color.Yellow;
         }

         // Add custom text to cell in the Calendar control.
         if (e.Day.Date.Day == 18)
         {
            e.Cell.Controls.Add(new LiteralControl("<br>Holiday"));
         }

      }

      void Page_Load(Object sender, EventArgs e)
      {

         // Manually register the event-handling method for the DayRender
  
         // event of the Calendar control.
         Calendar1.DayRender += new DayRenderEventHandler(this.DayRender);

      }

   </script>
 
</head>
 
<body>
 
   <form runat="server">

      <h3>Calendar DayRender Example</h3>
 
      <asp:Calendar id="Calendar1" 
                    runat="server">

         <WeekendDayStyle BackColor="gray">
         </WeekendDayStyle>

      </asp:Calendar>
                   
   </form>
          
</body>
</html>
   
.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
  System.Web.UI.WebControls.CalendarDay
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

CalendarDay コンストラクタ

CalendarDay クラスの新しいインスタンスを初期化します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    date As DateTime, _
    isWeekend As Boolean, _
    isToday As Boolean, _
    isSelected As Boolean, _
    isOtherMonth As Boolean, _
    dayNumberText As String _
)
Dim date As DateTime
Dim isWeekend As Boolean
Dim isToday As Boolean
Dim isSelected As Boolean
Dim isOtherMonth As Boolean
Dim dayNumberText As String

Dim instance As New CalendarDay(date,
 isWeekend, isToday, isSelected, isOtherMonth, dayNumberText)
public CalendarDay (
    DateTime date,
    bool isWeekend,
    bool isToday,
    bool isSelected,
    bool isOtherMonth,
    string dayNumberText
)
public:
CalendarDay (
    DateTime date, 
    bool isWeekend, 
    bool isToday, 
    bool isSelected, 
    bool isOtherMonth, 
    String^ dayNumberText
)
public CalendarDay (
    DateTime date, 
    boolean isWeekend, 
    boolean isToday, 
    boolean isSelected, 
    boolean isOtherMonth, 
    String dayNumberText
)
public function CalendarDay (
    date : DateTime, 
    isWeekend : boolean, 
    isToday : boolean, 
    isSelected : boolean, 
    isOtherMonth : boolean, 
    dayNumberText : String
)

パラメータ

date

このクラスのインスタンスで表される日付を格納する System.DateTime オブジェクト。

isWeekend

このクラスのインスタンスで表される日付が土曜日か日曜日である場合は true。それ以外の場合は false。

isToday

このクラスのインスタンスで表される日付が現在の日付である場合は true。それ以外の場合は false。

isSelected

このクラスのインスタンスで表される日付が Calendar コントロールで選択された日付である場合は true。それ以外の場合は false。

isOtherMonth

このクラスのインスタンスで表される日付が Calendar コントロールで表示された月以外の月の日付である場合は true。それ以外の場合は false。

dayNumberText

このクラスで表される日付の日付数字。

解説解説

このコンストラクタを使用して、CalendarDay クラスの新しいインスタンスを作成し、初期化します。

メモメモ

このコンストラクタは使用できますが、CalendarDay クラスのインスタンスは、通常は動的には作成されません。

CalendarDay のインスタンスの初期プロパティ値を次の表に示します。

プロパティ

初期値

日付

date パラメータの値。

DayNumberText

dayNumberText パラメータの値。

IsOtherMonth

isOtherMonth パラメータの値。

IsSelected

isSelected パラメータの値。

IsToday

isToday パラメータの値。

IsWeekend

isWeekEnd パラメータの値。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

CalendarDay プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

CalendarDay クラス
System.Web.UI.WebControls 名前空間
Calendar クラス
Calendar.DayRender イベント
DayRenderEventArgs
Day

その他の技術情報

Calendar Web サーバー コントロール

CalendarDay メソッド


CalendarDay メンバ

Calendar コントロールの日付を表します。

CalendarDay データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド CalendarDay CalendarDay クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

CalendarDay クラス
System.Web.UI.WebControls 名前空間
Calendar クラス
Calendar.DayRender イベント
DayRenderEventArgs
Day

その他の技術情報

Calendar Web サーバー コントロール

「calendar day」の例文・使い方・用例・文例

Weblio日本語例文用例辞書はプログラムで機械的に例文を生成しているため、不適切な項目が含まれていることもあります。ご了承くださいませ。


英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「CalendarDay」の関連用語

CalendarDayのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CalendarDayのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.
Tanaka Corpusのコンテンツは、特に明示されている場合を除いて、次のライセンスに従います:
 Creative Commons Attribution (CC-BY) 2.0 France.
この対訳データはCreative Commons Attribution 3.0 Unportedでライセンスされています。
浜島書店 Catch a Wave
Copyright © 1995-2026 Hamajima Shoten, Publishers. All rights reserved.
株式会社ベネッセコーポレーション株式会社ベネッセコーポレーション
Copyright © Benesse Holdings, Inc. All rights reserved.
研究社研究社
Copyright (c) 1995-2026 Kenkyusha Co., Ltd. All rights reserved.
日本語WordNet日本語WordNet
日本語ワードネット1.1版 (C) 情報通信研究機構, 2009-2010 License All rights reserved.
WordNet 3.0 Copyright 2006 by Princeton University. All rights reserved. License
日外アソシエーツ株式会社日外アソシエーツ株式会社
Copyright (C) 1994- Nichigai Associates, Inc., All rights reserved.
「斎藤和英大辞典」斎藤秀三郎著、日外アソシエーツ辞書編集部編
EDRDGEDRDG
This page uses the JMdict dictionary files. These files are the property of the Electronic Dictionary Research and Development Group, and are used in conformance with the Group's licence.

©2026 GRAS Group, Inc.RSS