【问题标题】:Is there a reference to WPF which enables controls being Draggable?是否有对 WPF 的引用使控件可以拖动?
【发布时间】:2018-10-12 14:58:43
【问题描述】:

我在 WPF 中有一个应用程序,我想在其中制作一些可在画布上拖动的控件。我知道有一个用于 Windows.Forms 的 Nuget 包 Control.Draggable 但它与我的 WPF 代码冲突:

using System.Windows.Forms;
public partial class MainWindow : Window
 {
 System.Windows.Controls.Button newButton = new System.Windows.Controls.Button();
 ControlExtension.Draggable(newButton, true);
  }

newButton 下划线的错误消息:

无法从“System.Windows.Controls.Button”转换为 'System.Windows.Forms.Control'

有什么办法可以克服这个错误并在 WPF 中轻松应用可拖动功能?

【问题讨论】:

标签: wpf forms draggable


【解决方案1】:

您可能想查看dong-wpf-dragdrop。它是一个开源库,可以轻松实现和使用 WPF 中的拖放功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-11
    • 2010-09-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多