MonthCalendar.AddBoldedDate メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MonthCalendar.AddBoldedDate メソッドの意味・解説 

MonthCalendar.AddBoldedDate メソッド

月間予定表太字表示される日付追加します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub AddBoldedDate ( _
    date As DateTime _
)
Dim instance As MonthCalendar
Dim date As DateTime

instance.AddBoldedDate(date)
public void AddBoldedDate (
    DateTime date
)
public:
void AddBoldedDate (
    DateTime date
)
public void AddBoldedDate (
    DateTime date
)
public function AddBoldedDate (
    date : DateTime
)

パラメータ

date

太字表示される日付

解説解説

表示更新するために、後で UpdateBoldedDates メソッド呼び出す必要があります

複数日付1 回割り当てによって追加するために、DateTime オブジェクト配列を BoldedDates プロパティ割り当てることができます

使用例使用例

AddBoldedDate メソッドおよび UpdateBoldedDates メソッド使用してファイルか読み取った日付マークし太字フォント表示するコード例次に示します。この例では、monthCalendar1 という名前の MonthCalendar コントロールForm追加されており、このメソッドがそのフォーム内に含まれ、そこから呼び出される必要があります

' The following method uses Add to add dates that are 
' bolded, followed by an UpdateBoldedDates to make the
' added dates visible.
Private Sub loadDates()
   Dim myInput As [String]
   Try
      Dim myInputStream As StreamReader = File.OpenText("myDates.txt")
      myInput = myInputStream.ReadLine()
      While Not myInput Is
 Nothing
         monthCalendar1.AddBoldedDate(DateTime.Parse(myInput.Substring(0, myInput.IndexOf("
 "))))
         listBox1.Items.Add(myInput)
         myInput = myInputStream.ReadLine()
      End While
      monthCalendar1.UpdateBoldedDates()
      myInputStream.Close()
      File.Delete("myDates.txt")
   Catch fnfe As FileNotFoundException
   End Try
End Sub 'loadDates
// The following method uses Add to add dates that are 
// bolded, followed by an UpdateBoldedDates to make the
// added dates visible.

private void loadDates()
{
    String myInput ;
    try
    {
        StreamReader myInputStream = File.OpenText("myDates.txt");
        while((myInput = myInputStream.ReadLine()) != null)
        {
            monthCalendar1.AddBoldedDate(DateTime.Parse(myInput.Substring(0,myInput.IndexOf("
 "))));
            listBox1.Items.Add(myInput);
        }
        monthCalendar1.UpdateBoldedDates();
        myInputStream.Close();
        File.Delete("myDates.txt");
    }catch(FileNotFoundException fnfe)
    {
        // Code to handle a file that could not be found should go here.
    Console.WriteLine("An error occurred: '{0}'", fnfe);
    }             
}
private:
   // The following method uses Add to add dates that are 
   // bolded, followed by an UpdateBoldedDates to make the
   // added dates visible.
   void loadDates()
   {
      String^ myInput;
      try
      {
         StreamReader^ myInputStream = File::OpenText( "myDates.txt" );
         while ( (myInput = myInputStream->ReadLine()) != nullptr
 )
         {
            monthCalendar1->AddBoldedDate( DateTime::Parse( myInput->Substring(
 0, myInput->IndexOf( " " ) ) ) );
            listBox1->Items->Add( myInput );
         }
         monthCalendar1->UpdateBoldedDates();
         myInputStream->Close();
         File::Delete( "myDates.txt" );
      }
      catch ( FileNotFoundException^ fnfe ) 
      {
         
         // Code to handle a file that could not be found should go
 here.
         Console::WriteLine( "An error occurred: '{0}'", fnfe );
      }

   }
// The following method uses Add to add dates that are 
// bolded, followed by an UpdateBoldedDates to make the
// added dates visible.
private void LoadDates()
{
    String myInput;
    try {
        StreamReader myInputStream = File.OpenText("myDates.txt");
        while ((myInput = myInputStream.ReadLine()) != null)
 {
            monthCalendar1.AddBoldedDate(DateTime.Parse(
                myInput.Substring(0, myInput.IndexOf(" "))));
            listBox1.get_Items().Add(myInput);
        }
        monthCalendar1.UpdateBoldedDates();
        myInputStream.Close();
        File.Delete("myDates.txt");
    }
    catch (FileNotFoundException fnfe) {
        // Code to handle a file that could not be found should go here.
        Console.WriteLine("An error occurred: '{0}'", fnfe);
    }
} //LoadDates
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MonthCalendar クラス
MonthCalendar メンバ
System.Windows.Forms 名前空間
UpdateBoldedDates
BoldedDates



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

辞書ショートカット

すべての辞書の索引

MonthCalendar.AddBoldedDate メソッドのお隣キーワード
検索ランキング

   

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



MonthCalendar.AddBoldedDate メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS