標準の Windows 水平スクロール バーを表します。
名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class HScrollBar
Inherits ScrollBar
Dim instance As HScrollBar
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
[ComVisibleAttribute(true)]
public class HScrollBar : ScrollBar
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
[ComVisibleAttribute(true)]
public ref class HScrollBar : public ScrollBar
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */
/** @attribute ComVisibleAttribute(true) */
public class HScrollBar extends ScrollBar
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)
ComVisibleAttribute(true)
public class HScrollBar extends ScrollBar
スクロール バーが必要な多くのコントロールには、既にスクロール バーが付いているため、このコントロールは必要ありません。スクロール バーが付いているコントロールには、複数行 TextBox コントロール、ListBox、ComboBox などがあります。
このコントロールを使用して、PictureBox などの固有のスクロール バーが付いていないコンテナや、数値データのユーザー入力にスクロール機能を実装できます。数値データは、コントロールに表示したり、コードで利用したりできます。Minimum プロパティおよび Maximum プロパティは、ユーザーが選択できる値の範囲を決定します。LargeChange プロパティは、スクロール ボックスの外側でスクロール バーの内側をクリックするときの効果を決定します。SmallChange プロパティは、コントロールの各終端でスクロール バーの矢印ボタンをクリックするときの効果を決定します。
HScrollBar を作成および初期化し、Form に追加する例を次に示します。
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
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);
}
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 );
}
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
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