SelectionRange クラスとは? わかりやすく解説

SelectionRange クラス

月間予定表コントロール選択されている日付範囲表します

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

Public NotInheritable Class
 SelectionRange
Dim instance As SelectionRange
public sealed class SelectionRange
public ref class SelectionRange sealed
public final class SelectionRange
public final class SelectionRange
解説解説
使用例使用例

Buttonクリックされたときに、2 つTextBox コントロール入力され2 つ日付基づいてMonthCalendar コントロールSelectionRange プロパティ設定する例を次に示します。このコードは、MonthCalendar コントロール新しインスタンス2 つTextBox コントロール、および ButtonForm 上に作成されていることを前提にしています。テキスト ボックス入力されText検証するためのコード追加し入力され日付が有効かどうか確認できます

Private Sub button1_Click(sender As
 Object, e As EventArgs)
   ' Set the SelectionRange with start and end dates from text boxes.
   Try
      monthCalendar1.SelectionRange = New SelectionRange( _
        DateTime.Parse(textBox1.Text), _
        DateTime.Parse(textBox2.Text))
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try
End Sub
private void button1_Click(object sender,
                           EventArgs e)
{
   // Set the SelectionRange with start and end dates from text boxes.
   try
   {
      monthCalendar1.SelectionRange = new SelectionRange(
        DateTime.Parse(textBox1.Text),
        DateTime.Parse(textBox2.Text));
   }
   catch(Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}
private:
   void button1_Click( Object^ sender, EventArgs^ e )
   {
      // Set the SelectionRange with start and end dates from text boxes.
      try
      {
         monthCalendar1->SelectionRange = gcnew SelectionRange(
            DateTime::Parse( textBox1->Text ),
            DateTime::Parse( textBox2->Text ) );
      }
      catch ( Exception^ ex ) 
      {
         MessageBox::Show( ex->Message );
      }
   }
private void button1_Click(Object sender, EventArgs
 e)
{
    // Set the SelectionRange with start and end dates from text boxes.
    try {
        monthCalendar1.set_SelectionRange(
        new SelectionRange(DateTime.Parse(textBox1.get_Text()),
 
            DateTime.Parse(textBox2.get_Text())));
    }
    catch (System.Exception ex) {
        MessageBox.Show(ex.get_Message());
    }
} //button1_Click
継承階層継承階層
System.Object
  System.Windows.Forms.SelectionRange
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「SelectionRange クラス」の関連用語

SelectionRange クラスのお隣キーワード
検索ランキング

   

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



SelectionRange クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS