由 c# zedgraph : how to use the cursor property?

标签 c# cursor zedgraph

在 ZedGraph 中,当您将鼠标悬停在图表上时,光标会从默认指针变为十字准线。我希望光标保持默认指针。但改变它,例如

zedGraphControl1.Cursor = Cursors.Arrow;

在设计器或代码中都没有影响。

有趣的是,我可以补充:

zedGraphControl1.UseWaitCursor = true;

并且当超过控制时它会显示一个沙漏。但以下内容:

zedGraphControl1.Cursor = Cursors.WaitCursor;

没有。顺便说一句,我将该行添加到 ZedGraph 演示程序之一中,因此我知道该程序可以正常工作。想法赞赏。

最佳答案

我没有足够的声誉通过接受的答案发表评论,但我认为这值得一提:

当使用 MouseMoveEvent 来覆盖光标时,返回一个 true 值以向 ZedGraph 表明您已经完全处理了该事件。请参阅以下文档中的片段:

Return true if you have handled the mouse event entirely, and you do not want the ZedGraphControl to do any further action (e.g., starting a zoom operation). Return false if ZedGraph should go ahead and process the mouse event.

例如

private bool zedGraphControl1_MouseMoveEvent(ZedGraphControl sender, MouseEventArgs e)
{
    this.Cursor = Cursors.Default;
    return true
}

如果不这样做,您可能会在 ZedGraph 默认光标(十字线)和您选择作为覆盖光标的任何内容之间看到闪烁效果。

关于由 c# zedgraph : how to use the cursor property?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17241481/

相关文章:

c# - 使用 XDocument.Save 格式化 kml 文件时出现问题

c# - 如何在 Xamarin.Forms 跨平台的特定页面上设置 ContentPage 方向或屏幕方向

c# - 我可以使用 Visual Studio 2013 (在 Windows 8.1 上运行)创建树莓派 2 应用程序(RPI2 运行 Windows 10 )吗?

python - Python 中的游标与连接

javascript - 当元素在其下方动态移动时,光标样式不会更新

c# - ZedGraph 减少标签和轴标签之间的距离?

c# - 对事件 ApplicationStarted 使用未定义的关键字值 0x1。在 EnterpriseLibrary SLAB 中

zedgraph - 如何为ZedGraph禁用鼠标滚轮缩放

c# - X 轴上带有日期和时间的折线图

cursor - 使用 Fabric lib 时,如何在 isDrawingMode 期间将光标设置为自定义光标文件