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



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

辞書ショートカット

すべての辞書の索引

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

   

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



ScrollableControl.ScrollControlIntoView メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS