本文整理汇总了C#中System.Windows.Input.QueryCursorEventArgs.GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# QueryCursorEventArgs.GetPosition方法的具体用法?C# QueryCursorEventArgs.GetPosition怎么用?C# QueryCursorEventArgs.GetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Input.QueryCursorEventArgs
的用法示例。
在下文中一共展示了QueryCursorEventArgs.GetPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnQueryCursor
protected override void OnQueryCursor(QueryCursorEventArgs e)
{
if (FindNextInsertionPoint(e.GetPosition(this)) >= 0)
e.Cursor = Cursors.UpArrow;
else
e.Cursor = Cursors.Arrow;
e.Handled = true;
}
示例2: textArea_QueryCursor
// provide the IBeam Cursor for the text area
void textArea_QueryCursor(object sender, QueryCursorEventArgs e)
{
if (!e.Handled) {
if (mode != SelectionMode.None) {
// during selection, use IBeam cursor even outside the text area
e.Cursor = Cursors.IBeam;
e.Handled = true;
} else if (textArea.TextView.VisualLinesValid) {
// Only query the cursor if the visual lines are valid.
// If they are invalid, the cursor will get re-queried when the visual lines
// get refreshed.
Point p = e.GetPosition(textArea.TextView);
if (p.X >= 0 && p.Y >= 0 && p.X <= textArea.TextView.ActualWidth && p.Y <= textArea.TextView.ActualHeight) {
int visualColumn;
bool isAtEndOfLine;
int offset = GetOffsetFromMousePosition(e, out visualColumn, out isAtEndOfLine);
if (enableTextDragDrop && textArea.Selection.Contains(offset))
e.Cursor = Cursors.Arrow;
else
e.Cursor = Cursors.IBeam;
e.Handled = true;
}
}
}
}
示例3: OnQueryCursor
private void OnQueryCursor(object sender, QueryCursorEventArgs e)
{
if (_isSelecting || GetFixedPanelDocumentPage(e.GetPosition(_scope)) != null)
{
e.Cursor = Cursors.Cross;
}
else
{
e.Cursor = Cursors.Arrow;
}
e.Handled = true;
}