ScrollableControl.ScrollControlIntoView メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ScrollableControl.ScrollControlIntoView メソッドの意味・解説 

ScrollableControl.ScrollControlIntoView メソッド

自動スクロール機能が有効になっているコントロール上で、指定した子コントロールが表示されるまでスクロールします。

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

Public Sub ScrollControlIntoView ( _
    activeControl As Control _
)
Dim instance As ScrollableControl
Dim activeControl As Control

instance.ScrollControlIntoView(activeControl)
public void ScrollControlIntoView (
    Control activeControl
)
public:
void ScrollControlIntoView (
    Control^ activeControl
)
public void ScrollControlIntoView (
    Control activeControl
)
public function ScrollControlIntoView (
    activeControl : Control
)

パラメータ

activeControl

スクロールして表示する子コントロール。

解説解説

ScrollControlIntoView メソッドの効果を出すには、AutoScroll プロパティを true に設定し、少なくとも 1 つのスクロール バー (水平または垂直) を表示しておく必要があります。水平スクロール バーを表示するには HScroll プロパティを、垂直スクロール バーを表示するには VScroll プロパティを、それぞれ true に設定します。

activeControl パラメータが子コントロールでない場合、アクションは実行されません。

このメソッドを呼び出すと、Scroll イベントが発生する場合があります。

使用例使用例

フォームでの自動スクロール機能を有効にしてそのフォームのサイズを変更し、サイズ変更した後もボタンが非表示にならないようにするコード例を次に示します。この例では、button2 という名前の Button が配置された Form が作成されている必要があります。

Private Sub ResizeForm()
   ' Enable auto-scrolling for the form.
   Me.AutoScroll = True
   
   ' Resize the form.
   Dim r As Rectangle = Me.ClientRectangle
   ' Subtract 100 pixels from each side of the Rectangle.
   r.Inflate(- 100, - 100)
   Me.Bounds = Me.RectangleToScreen(r)
   
   ' Make sure button2 is visible.
   Me.ScrollControlIntoView(button2)
End Sub
private void ResizeForm()
{
   // Enable auto-scrolling for the form.
   this.AutoScroll = true;

   // Resize the form.
   Rectangle r = this.ClientRectangle;
   // Subtract 100 pixels from each side of the Rectangle.
   r.Inflate(-100, -100);
   this.Bounds = this.RectangleToScreen(r);

   // Make sure button2 is visible.
   this.ScrollControlIntoView(button2);
}
private:
   void ResizeForm()
   {
      
      // Enable auto-scrolling for the form.
      this->AutoScroll = true;
      
      // Resize the form.
      Rectangle r = this->ClientRectangle;
      
      // Subtract 100 pixels from each side of the Rectangle.
      r.Inflate(  -100, -100 );
      this->Bounds = this->RectangleToScreen(
 r );
      
      // Make sure button2 is visible.
      this->ScrollControlIntoView( button2 );
   }
private void ResizeForm()
{
    // Enable auto-scrolling for the form.
    this.set_AutoScroll(true);
    // Resize the form.
    Rectangle r = this.get_ClientRectangle();
    // Subtract 100 pixels from each side of the Rectangle.
    r.Inflate(-100, -100);
    this.set_Bounds(this.RectangleToScreen(r));
    // Make sure button2 is visible.
    this.ScrollControlIntoView(button2);
} //ResizeForm
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ScrollableControl クラス
ScrollableControl メンバ
System.Windows.Forms 名前空間
AutoScroll
SetDisplayRectLocation
HScroll
VScroll
Scroll


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

英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

ScrollableControl.ScrollControlIntoView メソッドのお隣キーワード
検索ランキング

   

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



ScrollableControl.ScrollControlIntoView メソッドのページの著作権

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

©2026 GRAS Group, Inc.RSS