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

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

TrackBar.Minimum プロパティ

この TrackBar が使用する範囲下限値を取得または設定します

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

解説解説
使用例使用例

TickFrequency、MinimumMaximum の各メンバ使用方法、および ValueChanged イベント処理方法を示すコード例次に示します。この例を実行するには、TrackBar1 という名前の TrackBar コントロールTextBox1 という名前の TextBox コントロール配置されているフォーム次のコード貼り付けます。次にフォームコンストラクタまたは Loadイベント処理メソッドInitializeTrackBar メソッド呼び出します。

'Declare a new TrackBar object.
Friend WithEvents TrackBar1 As
 System.Windows.Forms.TrackBar

' Initalize the TrackBar and add it to the form.
Private Sub InitializeTrackBar()
    Me.TrackBar1 = New System.Windows.Forms.TrackBar

    ' Set the TickStyle property so there are ticks on both sides
    ' of the TrackBar.
    TrackBar1.TickStyle = TickStyle.Both

    ' Set the minimum and maximum number of ticks.
    TrackBar1.Minimum = 10
    TrackBar1.Maximum = 100

    ' Set the tick frequency to one tick every ten units.
    TrackBar1.TickFrequency = 10

    TrackBar1.Location = New System.Drawing.Point(75, 30)
    Me.Controls.Add(Me.TrackBar1)
End Sub


' Handle the TrackBar.ValueChanged event by calculating a value for
' TextBox1 based on the TrackBar value.  
Private Sub TrackBar1_ValueChanged(ByVal
 sender As Object, _
    ByVal e As System.EventArgs) Handles
 TrackBar1.ValueChanged
    TextBox1.Text = System.Math.Round(TrackBar1.Value / 10)
End Sub
//Declare a new TrackBar object.
internal System.Windows.Forms.TrackBar TrackBar1;

// Initalize the TrackBar and add it to the form.
private void InitializeTrackBar()
{
    this.TrackBar1 = new System.Windows.Forms.TrackBar();
    TrackBar1.Location = new System.Drawing.Point(75, 30);

    // Set the TickStyle property so there are ticks on both sides
    // of the TrackBar.
    TrackBar1.TickStyle = TickStyle.Both;

    // Set the minimum and maximum number of ticks.
    TrackBar1.Minimum = 10;
    TrackBar1.Maximum = 100;

    // Set the tick frequency to one tick every ten units.
    TrackBar1.TickFrequency = 10;

    // Associate the event-handling method with the 
    // ValueChanged event.
    TrackBar1.ValueChanged += 
        new System.EventHandler(TrackBar1_ValueChanged);
    this.Controls.Add(this.TrackBar1);
}


// Handle the TrackBar.ValueChanged event by calculating a value for
// TextBox1 based on the TrackBar value.  
private void TrackBar1_ValueChanged(object
 sender, System.EventArgs e)
{
    TextBox1.Text = (System.Math.Round(TrackBar1.Value/10.0)).ToString();
}
   //Declare a new TrackBar object.
internal:
   System::Windows::Forms::TrackBar^ TrackBar1;

   // Initalize the TrackBar and add it to the form.
private:
   void InitializeTrackBar()
   {
      this->TrackBar1 = gcnew System::Windows::Forms::TrackBar;
      TrackBar1->Location = System::Drawing::Point( 75, 30 );
      
      // Set the TickStyle property so there are ticks on both sides
      // of the TrackBar.
      TrackBar1->TickStyle = TickStyle::Both;
      
      // Set the minimum and maximum number of ticks.
      TrackBar1->Minimum = 10;
      TrackBar1->Maximum = 100;
      
      // Set the tick frequency to one tick every ten units.
      TrackBar1->TickFrequency = 10;
      
      // Associate the event-handling method with the 
      // ValueChanged event.
      TrackBar1->ValueChanged += gcnew System::EventHandler( this,
 &Form1::TrackBar1_ValueChanged );
      this->Controls->Add( this->TrackBar1
 );
   }

   // Handle the TrackBar.ValueChanged event by calculating a value
 for
   // TextBox1 based on the TrackBar value.  
   void TrackBar1_ValueChanged( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      TextBox1->Text = (System::Math::Round( TrackBar1->Value / 10.0 )).ToString();
   }
//Declare a new TrackBar object.
System.Windows.Forms.TrackBar trackBar1;

// Initalize the TrackBar and add it to the form.
private void InitializeTrackBar()
{
    this.trackBar1 = new System.Windows.Forms.TrackBar();
    trackBar1.set_Location(new System.Drawing.Point(75, 30));
    // Set the TickStyle property so there are ticks on both sides
    // of the TrackBar.
    trackBar1.set_TickStyle(TickStyle.Both);
    // Set the minimum and maximum number of ticks.
    trackBar1.set_Minimum(10);
    trackBar1.set_Maximum(100);
    // Set the tick frequency to one tick every ten units.
    trackBar1.set_TickFrequency(10);
    // Associate the event-handling method with the 
    // ValueChanged event.
    trackBar1.add_ValueChanged(new System.EventHandler(
        trackBar1_ValueChanged));
    this.get_Controls().Add(this.trackBar1);
} //InitializeTrackBar

// Handle the TrackBar.ValueChanged event by calculating a value for
// textBox1 based on the TrackBar value.  
private void trackBar1_ValueChanged(Object
 sender, System.EventArgs e)
{
    textBox1.set_Text(((System.Double)System.Math.Round(
        trackBar1.get_Value() / 10.0)).ToString());
} //trackBar1_ValueChanged
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS