Shehroz Saleem
Shehroz Saleem

Reputation: 196

Dragging and pressing buttons - Windows phone

I have several buttons and I would like to press on one of them and drag through another pressing them. Like swipe keyboard and want to get text from that button. How can i get the button text while i am dragging over them. I tried many method like manipulation gestures, toolkit gesture. Can you tell me the Exact way how can i do this. Thanks

Upvotes: 0

Views: 88

Answers (1)

Keval Langalia
Keval Langalia

Reputation: 1892

I think what you want, can be achieved by few EventHandlers like MouseEnter, MouseLeave & MouseMove etc. of each buttons..!

Check the code:

eg your button is:

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

and your code behind is:

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

Hope that helps..!

Upvotes: 1

Related Questions