Calendar.VisibleDate プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Calendar.VisibleDate プロパティの意味・解説 

Calendar.VisibleDate プロパティ

表示する月を指定する日付取得または設定します

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

<BindableAttribute(True)> _
Public Property VisibleDate As
 DateTime
Dim instance As Calendar
Dim value As DateTime

value = instance.VisibleDate

instance.VisibleDate = value
[BindableAttribute(true)] 
public DateTime VisibleDate { get; set;
 }
[BindableAttribute(true)] 
public:
property DateTime VisibleDate {
    DateTime get ();
    void set (DateTime value);
}
/** @property */
public DateTime get_VisibleDate ()

/** @property */
public void set_VisibleDate (DateTime value)

プロパティ
表示する月を指定する日付既定値は DateTime.MinValue です。

解説解説

VisibleDate プロパティは、Calendar.VisibleMonthChanged イベント発生した後に更新されます。

目的の月のうちの任意の日付指定できますDateTime オブジェクトの値の月の部分だけが使用されます。

このプロパティには、Web フォームの Calendar.VisibleDate プロパティと同じ機能あります

使用例使用例

VisibleDate プロパティ使用してカレンダー表示する日付設定する方法コード例次に示します。このコード例は、Calendar概要取り上げているコード例一部です。

Dim currentDay As Integer
 = Calendar1.VisibleDate.Day
Dim currentMonth As Integer
 = Calendar1.VisibleDate.Month
Dim currentYear As Integer
 = Calendar1.VisibleDate.Year
int currentDay = Calendar1.VisibleDate.Day;
int currentMonth = Calendar1.VisibleDate.Month;
int currentYear = Calendar1.VisibleDate.Year;
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Calendar.VisibleDate プロパティ

Calendar コントロール表示する月を指定する日付取得または設定します

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

<BindableAttribute(True)> _
Public Property VisibleDate As
 DateTime
Dim instance As Calendar
Dim value As DateTime

value = instance.VisibleDate

instance.VisibleDate = value
[BindableAttribute(true)] 
public DateTime VisibleDate { get; set;
 }
[BindableAttribute(true)] 
public:
property DateTime VisibleDate {
    DateTime get ();
    void set (DateTime value);
}
/** @property */
public DateTime get_VisibleDate ()

/** @property */
public void set_VisibleDate (DateTime value)

プロパティ
Calendar表示する月を指定する System.DateTime。既定値は DateTime.MinValue で、TodaysDate で指定され日付を含む月が表示されます。

解説解説
使用例使用例

VisibleDate プロパティ使用してCalendar コントロール表示される月を決定する値をプログラムによって設定する方法次のコード例示します

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

<html>
<head>

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

        Sub ButtonClick(sender As Object,
 e As EventArgs)
            Calendar1.VisibleDate = New DateTime(Calendar1.TodaysDate.Year,
 DropList1.SelectedIndex + 1, 1)
            Label1.Text = "The VisibleDate property is "
 & Calendar1.VisibleDate.ToShortDateString()
        End Sub 'ButtonClick

   </script>

</head>     
<body>

   <form runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="Calendar1" runat="server"
  
           SelectionMode="None" 
           ShowGridLines="True">
 
         <SelectedDayStyle BackColor="Yellow"
                           ForeColor="Red">
         </SelectedDayStyle>

      </asp:Calendar>

      <hr><br>

      Select the month to display: <br>

      <asp:DropDownList id="DropList1" runat="server">

         <asp:ListItem>1</asp:ListItem>
         <asp:ListItem>2</asp:ListItem>
         <asp:ListItem>3</asp:ListItem>
         <asp:ListItem>4</asp:ListItem>
         <asp:ListItem>5</asp:ListItem>
         <asp:ListItem>6</asp:ListItem>
         <asp:ListItem>7</asp:ListItem>
         <asp:ListItem>8</asp:ListItem>
         <asp:ListItem>9</asp:ListItem>
         <asp:ListItem>10</asp:ListItem>
         <asp:ListItem>11</asp:ListItem>
         <asp:ListItem>12</asp:ListItem>

      </asp:DropDownList>

      <asp:Button id="Button1" 
           Text="Submit"
           OnClick="ButtonClick"
           runat=server />

      <br><br>

      <asp:Label id="Label1" runat="server"/>

   </form>
</body>
</html>

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

<html>
<head>

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

      void ButtonClick(Object sender, EventArgs e) 
      {
         Calendar1.VisibleDate = new DateTime(Calendar1.TodaysDate.Year,
 
                                              DropList1.SelectedIndex + 1, 
                                              1);
         Label1.Text = "The VisibleDate property is " + 
                       Calendar1.VisibleDate.ToShortDateString();
      }

   </script>

</head>     
<body>

   <form runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="Calendar1" runat="server"  
           SelectionMode="None" 
           ShowGridLines="True">
 
         <SelectedDayStyle BackColor="Yellow"
                           ForeColor="Red">
         </SelectedDayStyle>

      </asp:Calendar>

      <hr><br>

      Select the month to display: <br>

      <asp:DropDownList id="DropList1" runat="server">

         <asp:ListItem>1</asp:ListItem>
         <asp:ListItem>2</asp:ListItem>
         <asp:ListItem>3</asp:ListItem>
         <asp:ListItem>4</asp:ListItem>
         <asp:ListItem>5</asp:ListItem>
         <asp:ListItem>6</asp:ListItem>
         <asp:ListItem>7</asp:ListItem>
         <asp:ListItem>8</asp:ListItem>
         <asp:ListItem>9</asp:ListItem>
         <asp:ListItem>10</asp:ListItem>
         <asp:ListItem>11</asp:ListItem>
         <asp:ListItem>12</asp:ListItem>

      </asp:DropDownList>

      <asp:Button id="Button1" 
           Text="Submit"
           OnClick="ButtonClick"
           runat=server />

      <br><br>

      <asp:Label id="Label1" runat="server"/>

   </form>
</body>
</html>

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

<html>
<head>

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

      function ButtonClick(sender : Object, e : EventArgs) 
      {
         Calendar1.VisibleDate = new DateTime(Calendar1.TodaysDate.Year,
 
                                              DropList1.SelectedIndex + 1, 
                                              1);
         Label1.Text = "The VisibleDate property is " + 
                       Calendar1.VisibleDate.ToShortDateString();
      }

   </script>

</head>     
<body>

   <form runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="Calendar1" runat="server"  
           SelectionMode="None" 
           ShowGridLines="True">
 
         <SelectedDayStyle BackColor="Yellow"
                           ForeColor="Red">
         </SelectedDayStyle>

      </asp:Calendar>

      <hr><br>

      Select the month to display: <br>

      <asp:DropDownList id="DropList1" runat="server">

         <asp:ListItem>1</asp:ListItem>
         <asp:ListItem>2</asp:ListItem>
         <asp:ListItem>3</asp:ListItem>
         <asp:ListItem>4</asp:ListItem>
         <asp:ListItem>5</asp:ListItem>
         <asp:ListItem>6</asp:ListItem>
         <asp:ListItem>7</asp:ListItem>
         <asp:ListItem>8</asp:ListItem>
         <asp:ListItem>9</asp:ListItem>
         <asp:ListItem>10</asp:ListItem>
         <asp:ListItem>11</asp:ListItem>
         <asp:ListItem>12</asp:ListItem>

      </asp:DropDownList>

      <asp:Button id="Button1" 
           Text="Submit"
           OnClick="ButtonClick"
           runat=server />

      <br><br>

      <asp:Label id="Label1" runat="server"/>

   </form>
</body>
</html>

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



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Calendar.VisibleDate プロパティ」の関連用語

Calendar.VisibleDate プロパティのお隣キーワード
検索ランキング

   

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



Calendar.VisibleDate プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS