【问题标题】:Dragging and pressing buttons - Windows phone拖动和按下按钮 - Windows 手机
【发布时间】:2015-04-22 12:15:53
【问题描述】:

我有几个按钮,我想按下其中一个并拖动另一个按下它们。就像滑动键盘一样,想要从该按钮获取文本。我如何在拖动按钮时获取按钮文本。我尝试了很多方法,比如操作手势、工具包手势。你能告诉我我该怎么做的确切方法吗?谢谢

【问题讨论】:

  • 在这里,您是想在拖动其他按钮时移动按钮,还是只想要与SwipeKyeboard 中相同的行为?
  • 想要与滑动键盘相同的行为..

标签: c# windows windows-phone-8 drag


【解决方案1】:

我认为你想要的,可以通过几个EventHandlersMouseEnterMouseLeave & MouseMove 等每个按钮来实现..!

检查代码:

例如,您的按钮是:

    <Button Content="a"
            KeyDown="btn_keyDown" MouseEnter="btn_mouseEnter" 
            MouseMove="Button_MouseMove"/>

你的代码是:

    private void Button_mouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
    {
        tb.Text += (sender as Button).Content as string;
    }

希望对您有所帮助..!

【讨论】:

    猜你喜欢
    • 2012-12-02
    • 2015-12-04
    • 2016-02-27
    • 1970-01-01
    • 1970-01-01
    • 2012-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多