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

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

ControlPaint.DrawReversibleLine メソッド

画面反転できる線を、指定した開始点と指定したエンド ポイントの間に、指定した背景色使用して描画ます。

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

Public Shared Sub DrawReversibleLine
 ( _
    start As Point, _
    end As Point, _
    backColor As Color _
)
Dim start As Point
Dim end As Point
Dim backColor As Color

ControlPaint.DrawReversibleLine(start, end, backColor)
public static void DrawReversibleLine
 (
    Point start,
    Point end,
    Color backColor
)
public:
static void DrawReversibleLine (
    Point start, 
    Point end, 
    Color backColor
)
public static void DrawReversibleLine
 (
    Point start, 
    Point end, 
    Color backColor
)
public static function DrawReversibleLine
 (
    start : Point, 
    end : Point, 
    backColor : Color
)

パラメータ

start

画面座標の線の始点となる Point

end

画面座標の線のエンド ポイントとなる Point

backColor

線の背景Color

解説解説
使用例使用例

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS