ScrollableControl.ScrollControlIntoView メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As ScrollableControl Dim activeControl As Control instance.ScrollControlIntoView(activeControl)

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

フォームでの自動スクロール機能を有効にしてそのフォームのサイズを変更し、サイズ変更した後もボタンが非表示にならないようにするコード例を次に示します。この例では、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

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からScrollableControl.ScrollControlIntoView メソッドを検索する場合は、下記のリンクをクリックしてください。

- ScrollableControl.ScrollControlIntoView メソッドのページへのリンク