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

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

TrackBar.SmallChange プロパティ

スクロール ボックスわずかに移動したときに Value プロパティに対して加算または減算される値を取得または設定します

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

Dim instance As TrackBar
Dim value As Integer

value = instance.SmallChange

instance.SmallChange = value
public int SmallChange { get;
 set; }
public:
property int SmallChange {
    int get ();
    void set (int value);
}
/** @property */
public int get_SmallChange ()

/** @property */
public void set_SmallChange (int
 value)
public function get SmallChange
 () : int

public function set SmallChange
 (value : int)

プロパティ
数値既定値は、1 です。

例外例外
例外種類条件

ArgumentException

代入される値が 0 未満です。

解説解説
使用例使用例

TrackBar コントロールTextBox コントロール配置されフォーム表示するコード例次に示します。この例では、Maximum、TickFrequency、LargeChange、SmallChange の各プロパティ設定してScroll イベント処理してます。TextBox内容は、Scroll イベント発生したときに、Value プロパティの値に更新されます。

Imports System
Imports System.Drawing
Imports System.Windows.Forms

Public Class Form1
    Inherits System.Windows.Forms.Form

    Private WithEvents trackBar1 As
 System.Windows.Forms.TrackBar
    Private textBox1 As System.Windows.Forms.TextBox

    <System.STAThread()> _
    Public Shared Sub Main()
        System.Windows.Forms.Application.Run(New Form1)
    End Sub 'Main

    Public Sub New()
        Me.textBox1 = New System.Windows.Forms.TextBox
        Me.trackBar1 = New System.Windows.Forms.TrackBar

        ' TextBox for TrackBar.Value update.
        Me.textBox1.Location = New System.Drawing.Point(240,
 16)
        Me.textBox1.Size = New System.Drawing.Size(48,
 20)

        ' Set up how the form should be displayed and add the controls
 to the form.
        Me.ClientSize = New System.Drawing.Size(296,
 62)
        Me.Controls.AddRange(New System.Windows.Forms.Control()
 {Me.textBox1, Me.trackBar1})
        Me.Text = "TrackBar Example"

        ' Set up the TrackBar.
        Me.trackBar1.Location = New System.Drawing.Point(8,
 8)
        Me.trackBar1.Size = New System.Drawing.Size(224,
 45)

        ' The Maximum property sets the value of the track bar when
        ' the slider is all the way to the right.
        trackBar1.Maximum = 30

        ' The TickFrequency property establishes how many positions
        ' are between each tick-mark.
        trackBar1.TickFrequency = 5

        ' The LargeChange property sets how many positions to move
        ' if the bar is clicked on either side of the slider.
        trackBar1.LargeChange = 3

        ' The SmallChange property sets how many positions to move
        ' if the keyboard arrows are used to move the slider.
        trackBar1.SmallChange = 2
    End Sub 'New

    Private Sub trackBar1_Scroll(ByVal
 sender As Object, _
                    ByVal e As System.EventArgs)
 Handles trackBar1.Scroll

        ' Display the trackbar value in the text box.
        textBox1.Text = trackBar1.Value
    End Sub 

End Class 'Form1
using System;
using System.Drawing;
using System.Windows.Forms;

public class Form1 : System.Windows.Forms.Form
{
    private System.Windows.Forms.TrackBar trackBar1;
    private System.Windows.Forms.TextBox textBox1;

    [STAThread]
    static void Main() 
    {
        Application.Run(new Form1());
    }

    public Form1()
    {
        this.textBox1 = new System.Windows.Forms.TextBox();
        this.trackBar1 = new System.Windows.Forms.TrackBar();

        // TextBox for TrackBar.Value update.
        this.textBox1.Location = new System.Drawing.Point(240,
 16);
        this.textBox1.Size = new System.Drawing.Size(48,
 20);

        // Set up how the form should be displayed and add the controls
 to the form.
        this.ClientSize = new System.Drawing.Size(296,
 62);
        this.Controls.AddRange(new System.Windows.Forms.Control[]
 {this.textBox1,this.trackBar1});
        this.Text = "TrackBar Example";

        // Set up the TrackBar.
        this.trackBar1.Location = new System.Drawing.Point(8,
 8);
        this.trackBar1.Size = new System.Drawing.Size(224,
 45);
        this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);

        // The Maximum property sets the value of the track bar when
        // the slider is all the way to the right.
        trackBar1.Maximum = 30;
        
        // The TickFrequency property establishes how many positions
        // are between each tick-mark.
        trackBar1.TickFrequency = 5;

        // The LargeChange property sets how many positions to move
        // if the bar is clicked on either side of the slider.
        trackBar1.LargeChange = 3;

        // The SmallChange property sets how many positions to move
        // if the keyboard arrows are used to move the slider.
        trackBar1.SmallChange = 2;
    }


    private void trackBar1_Scroll(object sender,
 System.EventArgs e)
    {
        // Display the trackbar value in the text box.
        textBox1.Text = "" + trackBar1.Value;
    }
}
using namespace System;
using namespace System::Drawing;
using namespace System::Windows::Forms;
public ref class Form1: public
 System::Windows::Forms::Form
{
private:
   System::Windows::Forms::TrackBar^ trackBar1;
   System::Windows::Forms::TextBox^ textBox1;

public:
   Form1()
   {
      this->textBox1 = gcnew System::Windows::Forms::TextBox;
      this->trackBar1 = gcnew System::Windows::Forms::TrackBar;
      
      // TextBox for TrackBar::Value update.
      this->textBox1->Location = System::Drawing::Point(
 240, 16 );
      this->textBox1->Size = System::Drawing::Size( 48,
 20 );
      
      // Set up how the form should be displayed and add the controls
 to the form.
      this->ClientSize = System::Drawing::Size( 296, 62 );
      array<System::Windows::Forms::Control^>^formControls = {this->textBox1
,this->trackBar1};
      this->Controls->AddRange( formControls );
      this->Text = "TrackBar Example";
      
      // Set up the TrackBar.
      this->trackBar1->Location = System::Drawing::Point(
 8, 8 );
      this->trackBar1->Size = System::Drawing::Size( 224,
 45 );
      this->trackBar1->Scroll += gcnew System::EventHandler(
 this, &Form1::trackBar1_Scroll );
      
      // The Maximum property sets the value of the track bar when
      // the slider is all the way to the right.
      trackBar1->Maximum = 30;
      
      // The TickFrequency property establishes how many positions
      // are between each tick-mark.
      trackBar1->TickFrequency = 5;
      
      // The LargeChange property sets how many positions to move
      // if the bar is clicked on either side of the slider.
      trackBar1->LargeChange = 3;
      
      // The SmallChange property sets how many positions to move
      // if the keyboard arrows are used to move the slider.
      trackBar1->SmallChange = 2;
   }


private:
   void trackBar1_Scroll( Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      
      // Display the trackbar value in the text box.
      textBox1->Text = String::Concat( "", trackBar1->Value );
   }

};


[STAThread]
int main()
{
   Application::Run( gcnew Form1 );
}

import System.*;
import System.Drawing.*;
import System.Windows.Forms.*;

public class Form1 extends System.Windows.Forms.Form
{
    private System.Windows.Forms.TrackBar trackBar1;
    private System.Windows.Forms.TextBox textBox1;

    /** @attribute STAThread()
     */
    public static void main(String[]
 args)
    {
        Application.Run(new Form1());
    } //main

    public Form1()
    {
        this.textBox1 = new System.Windows.Forms.TextBox();
        this.trackBar1 = new System.Windows.Forms.TrackBar();
        // TextBox for TrackBar.Value update.
        this.textBox1.set_Location(new System.Drawing.Point(240,
 16));
        this.textBox1.set_Size(new System.Drawing.Size(48,
 20));
        // Set up how the form should be displayed and add the controls
 to the
        // form.
        this.set_ClientSize(new System.Drawing.Size(296,
 62));
        this.get_Controls().AddRange(new System.Windows.Forms.Control[]
 { 
            this.textBox1, this.trackBar1 });
        this.set_Text("TrackBar Example");
        // Set up the TrackBar.
        this.trackBar1.set_Location(new System.Drawing.Point(8,
 8));
        this.trackBar1.set_Size(new System.Drawing.Size(224,
 45));
        this.trackBar1.add_Scroll(new System.EventHandler(this.trackBar1_Scroll));
        // The Maximum property sets the value of the track bar when
        // the slider is all the way to the right.
        trackBar1.set_Maximum(30);
        // The TickFrequency property establishes how many positions
        // are between each tick-mark.
        trackBar1.set_TickFrequency(5);
        // The LargeChange property sets how many positions to move
        // if the bar is clicked on either side of the slider.
        trackBar1.set_LargeChange(3);
        // The SmallChange property sets how many positions to move
        // if the keyboard arrows are used to move the slider.
        trackBar1.set_SmallChange(2);
    } //Form1

    private void trackBar1_Scroll(Object sender,
 System.EventArgs e)
    {
        // Display the trackbar value in the text box.
        textBox1.set_Text("" + trackBar1.get_Value());
    } //trackBar1_Scroll
} //Form1
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からTrackBar.SmallChange プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTrackBar.SmallChange プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTrackBar.SmallChange プロパティを検索

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS