PowerTools PlusPak for Windows Forms 8.0J
MouseWheelTarget プロパティ
使用例 

マウスホイールメッセージのターゲットを取得または設定します。
構文
Public Property MouseWheelTarget As MouseWheelTarget
public MouseWheelTarget MouseWheelTarget {get; set;}

プロパティ値

マウスホイールメッセージのターゲットを示す MouseWheelTarget 列挙値の 1 つ。デフォルト値は FocusedControl で、これはマウスホイールメッセージのデフォルトのディスパッチポリシーです。
解説
このプロパティが SpecifiedControl に設定されているのに、MouseWheelTargetControl プロパティが null 参照 (Visual Basicでは Nothing) に設定されている場合、マウスホイールメッセージはフォーカスのあるコントロールに送信されます(つまり、デフォルトの動作が実行されます)。
使用例

次のサンプルコードは、MouseWheelTarget プロパティを使用して WM_MOUSEWHEEL メッセージのターゲットを指定する方法を示します。このサンプルコードを実行するには、以下のコードを System.Windows.Forms.Form プロジェクトに追加し、ここで作成したメソッドをコンストラクタまたはフォーム上の別のメソッドから呼び出します。

private void CreateGcMouseWithMouseWheelTarget()
{
    // Create an instance of GcMouse control.
    GcMouse gcMouse = new GcMouse();

    // Set mouse wheel target as mouse hover control for gcMouse.
    gcMouse.MouseWheelTarget = MouseWheelTarget.HoveredControl;

    // Set this form as target form of gcMouse
    gcMouse.TargetForm = this;
}
Private Sub CreateGcMouseWithMouseWheelTarget()
    ' Create an instance of GcMouse control.
    Dim gcMouse As New GcMouse()

    ' Set mouse wheel target as mouse hover control for gcMouse.
    gcMouse.MouseWheelTarget = MouseWheelTarget.HoveredControl

    ' Set this form as target form of gcMouse
    gcMouse.TargetForm = Me
End Sub
プラットフォーム

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

参照

GcMouse クラス
GcMouse メンバ
MouseWheelTargetControl プロパティ

Send Feedback