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

Dim start As Point Dim end As Point Dim backColor As Color ControlPaint.DrawReversibleLine(start, end, backColor)

backColor パラメータを使用して、線が背景に対して常に表示されるように、線の塗りつぶし色を計算します。
このメソッドの結果、同じ線を再び描画することによって反転できます。このメソッドを使用して線を描画することは、より多くの色に対してより優れたパフォーマンスが提供されることを除いて、画面の領域を反転することに似ています。

ControlPaint.DrawReversibleLine メソッドと Control.PointToScreen メソッドを使用するコード例を次に示します。この例を実行するには、次のコードをフォームに貼り付けます。そして、Button3 という名前のボタンをフォームに追加し、すべてのイベントを必ずそれぞれのイベント ハンドラに関連付けます。
' When the mouse hovers over Button3, two reversible lines are drawn ' using the corner coordinates of Button3, which are first ' converted to screen coordinates. Private Sub Button3_MouseHover(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Button3.MouseHover ControlPaint.DrawReversibleLine(Button3.PointToScreen(New Point(0, 0)), _ Button3.PointToScreen(New Point(Button3.ClientRectangle.Right, _ Button3.ClientRectangle.Bottom)), SystemColors.Control) ControlPaint.DrawReversibleLine(Button3.PointToScreen( _ New Point(Button3.ClientRectangle.Right, Button3.ClientRectangle.Top)), _ Button3.PointToScreen(New Point _ (Button1.ClientRectangle.Left, Button3.ClientRectangle.Bottom)), _ SystemColors.Control) End Sub ' When the mouse moves from Button3, the reversible lines are ' erased by using the same coordinates as are used in the ' Button3_MouseHover method. Private Sub Button3_MouseLeave(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Button3.MouseLeave ControlPaint.DrawReversibleLine(Button3.PointToScreen(New Point(0, 0)), _ Button3.PointToScreen(New Point(Button3.ClientRectangle.Right, _ Button3.ClientRectangle.Bottom)), SystemColors.Control) ControlPaint.DrawReversibleLine(Button3.PointToScreen( _ New Point(Button3.ClientRectangle.Right, Button3.ClientRectangle.Top)), _ Button3.PointToScreen(New Point(Button3.ClientRectangle.Left, _ Button3.ClientRectangle.Bottom)), SystemColors.Control) End Sub
// When the mouse hovers over Button3, two reversible lines are // drawn using the corner coordinates of Button3, which are first // converted to screen coordinates. private void Button3_MouseHover(object sender, System.EventArgs e) { ControlPaint.DrawReversibleLine(Button3.PointToScreen( new Point(0, 0)), Button3.PointToScreen( new Point(Button3.ClientRectangle.Right, Button3.ClientRectangle.Bottom)), SystemColors.Control); ControlPaint.DrawReversibleLine(Button3.PointToScreen( new Point(Button3.ClientRectangle.Right, Button3.ClientRectangle.Top)), Button3.PointToScreen(new Point(Button1.ClientRectangle.Left, Button3.ClientRectangle.Bottom)), SystemColors.Control); } // When the mouse moves from Button3, the reversible lines are erased by // using the same coordinates as are used in the Button3_MouseHover method. private void Button3_MouseLeave(object sender, System.EventArgs e) { ControlPaint.DrawReversibleLine(Button3.PointToScreen( new Point(0, 0)), Button3.PointToScreen( new Point(Button3.ClientRectangle.Right, Button3.ClientRectangle.Bottom)), SystemColors.Control); ControlPaint.DrawReversibleLine(Button3.PointToScreen( new Point(Button3.ClientRectangle.Right, Button3.ClientRectangle.Top)), Button3.PointToScreen(new Point(Button3.ClientRectangle.Left , Button3.ClientRectangle.Bottom)), SystemColors.Control); }
// When the mouse hovers over Button3, two reversible lines are // drawn using the corner coordinates of Button3, which are first // converted to screen coordinates. void Button3_MouseHover( Object^ /*sender*/, System::EventArgs^ /*e*/ ) { ControlPaint::DrawReversibleLine( Button3->PointToScreen( Point(0,0) ), Button3->PointToScreen( Point(Button3->ClientRectangle.Right,Button3->ClientRectangle.Bottom) ), SystemColors::Control ); ControlPaint::DrawReversibleLine( Button3->PointToScreen( Point(Button3->ClientRectangle.Right,Button3->ClientRectangle.Top) ), Button3->PointToScreen( Point(Button1->ClientRectangle.Left,Button3->ClientRectangle.Bottom) ), SystemColors::Control ); } // When the mouse moves from Button3, the reversible lines are erased by // using the same coordinates as are used in the Button3_MouseHover method. void Button3_MouseLeave( Object^ /*sender*/, System::EventArgs^ /*e*/ ) { ControlPaint::DrawReversibleLine( Button3->PointToScreen( Point(0,0) ), Button3->PointToScreen( Point(Button3->ClientRectangle.Right,Button3->ClientRectangle.Bottom) ), SystemColors::Control ); ControlPaint::DrawReversibleLine( Button3->PointToScreen( Point(Button3->ClientRectangle.Right,Button3->ClientRectangle.Top) ), Button3->PointToScreen( Point(Button3->ClientRectangle.Left,Button3->ClientRectangle.Bottom) ), SystemColors::Control ); }
// When the mouse hovers over button3, two reversible lines are // drawn using the corner coordinates of button3, which are first // converted to screen coordinates. private void button3_MouseHover(Object sender, System.EventArgs e) { ControlPaint.DrawReversibleLine(button3.PointToScreen(new Point(0, 0)), button3.PointToScreen(new Point(button3.get_ClientRectangle(). get_Right(), button3.get_ClientRectangle().get_Bottom())), SystemColors.get_Control()); ControlPaint.DrawReversibleLine(button3.PointToScreen( new Point(button3.get_ClientRectangle().get_Right(), button3.get_ClientRectangle().get_Top())), button3.PointToScreen(new Point( button1.get_ClientRectangle().get_Left(), button3.get_ClientRectangle().get_Bottom())), SystemColors.get_Control()); } //button3_MouseHover // When the mouse moves from button3, the reversible lines are erased by // using the same coordinates as are used in the button3_MouseHover method. private void button3_MouseLeave(Object sender, System.EventArgs e) { ControlPaint.DrawReversibleLine(button3.PointToScreen( new Point(0, 0)), button3.PointToScreen( new Point(button3.get_ClientRectangle().get_Right(), button3.get_ClientRectangle().get_Bottom())), SystemColors.get_Control()); ControlPaint.DrawReversibleLine(button3.PointToScreen( new Point(button3.get_ClientRectangle().get_Right(), button3.get_ClientRectangle().get_Top())), button3.PointToScreen(new Point( button3.get_ClientRectangle().get_Left(), button3.get_ClientRectangle().get_Bottom())), SystemColors.get_Control()); } //button3_MouseLeave

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に収録されているすべての辞書からControlPaint.DrawReversibleLine メソッドを検索する場合は、下記のリンクをクリックしてください。

- ControlPaint.DrawReversibleLine メソッドのページへのリンク