System.Windows.Forms


.NET Framework クラス ライブラリ
HScrollBar クラス

標準の Windows 水平スクロール バーを表します。

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

構文

Visual Basic (宣言)
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class HScrollBar
    Inherits ScrollBar
Visual Basic (使用法)
Dim instance As HScrollBar
C#
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
[ComVisibleAttribute(true)] 
public class HScrollBar : ScrollBar
C++
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
[ComVisibleAttribute(true)] 
public ref class HScrollBar : public ScrollBar
J#
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
/** @attribute ComVisibleAttribute(true) */ 
public class HScrollBar extends ScrollBar
JScript
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
ComVisibleAttribute(true) 
public class HScrollBar extends ScrollBar
解説

スクロール バーが必要な多くのコントロールには、既にスクロール バーが付いているため、このコントロールは必要ありません。スクロール バーが付いているコントロールには、複数行 TextBox コントロール、ListBoxComboBox などがあります。

このコントロールを使用して、PictureBox などの固有のスクロール バーが付いていないコンテナや、数値データのユーザー入力にスクロール機能を実装できます。数値データは、コントロールに表示したり、コードで利用したりできます。Minimum プロパティおよび Maximum プロパティは、ユーザーが選択できる値の範囲を決定します。LargeChange プロパティは、スクロール ボックスの外側でスクロール バーの内側をクリックするときの効果を決定します。SmallChange プロパティは、コントロールの各終端でスクロール バーの矢印ボタンをクリックするときの効果を決定します。

使用例

HScrollBar を作成および初期化し、Form に追加する例を次に示します。

Visual Basic
Private Sub InitializeMyScrollBar()
    ' Create and initialize an HScrollBar.
    Dim hScrollBar1 As New HScrollBar()
    
    ' Dock the scroll bar to the bottom of the form.
    hScrollBar1.Dock = DockStyle.Bottom
    
    ' Add the scroll bar to the form.
    Controls.Add(hScrollBar1)
End Sub 'InitializeMyScrollBar
C#
private void InitializeMyScrollBar()
 {
    // Create and initialize an HScrollBar.
    HScrollBar hScrollBar1 = new HScrollBar();
    
    // Dock the scroll bar to the bottom of the form.
    hScrollBar1.Dock = DockStyle.Bottom;
    
    // Add the scroll bar to the form.
    Controls.Add(hScrollBar1);
 }
    
C++
private:
   void InitializeMyScrollBar()
   {
      // Create and initialize an HScrollBar.
      HScrollBar^ hScrollBar1 = gcnew HScrollBar;
      
      // Dock the scroll bar to the bottom of the form.
      hScrollBar1->Dock = DockStyle::Bottom;
      
      // Add the scroll bar to the form.
      Controls->Add( hScrollBar1 );
   }
J#
private void InitializeMyScrollBar()
{
    // Create and initialize an HScrollBar.
    HScrollBar hScrollBar1 = new HScrollBar();

    // Dock the scroll bar to the bottom of the form.
    hScrollBar1.set_Dock(DockStyle.Bottom);

    // Add the scroll bar to the form.
    get_Controls().Add(hScrollBar1);
} //InitializeMyScrollBar
JScript
function InitializeMyScrollBar(){
    // Create and initialize an HScrollBar.
    var hScrollBar1 : HScrollBar = new HScrollBar()
    
    // Dock the scroll bar to the bottom of the form.
    hScrollBar1.Dock = DockStyle.Bottom
    
    // Add the scroll bar to the form.
    Controls.Add(hScrollBar1)
}
継承階層

System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Windows.Forms.Control
         System.Windows.Forms.ScrollBar
          System.Windows.Forms.HScrollBar
スレッド セーフ

この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォーム

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

.NET Compact Framework

サポート対象 : 2.0、1.0
参照

タグ :


Page view tracker