「Xamarin.Macでウインドウ座標をビュー座標に変換する」の版間の差分

編集の要約なし
imported>Administrator
 
(他の1人の利用者による、間の1版が非表示)
6行目: 6行目:


<source lang="csharp">
<source lang="csharp">
public override void MouseDown(NSEvent theEvent)
public class CustomView : NSView
{
{
     var wLocation = theEvent.LocationInWindow;
     public override void MouseDown(NSEvent theEvent)
    var vLocation = ConvertPointFromView(wLocation, null);
    {
        // これウインドウ座標
        var wLocation = theEvent.LocationInWindow;
       
        // ビュー座標に変換
        // 似たような名前のメソッドがいっぱいあるので注意。
        var vLocation = this.ConvertPointFromView(wLocation, aView:null);
    }
}
}
</source>
</source>