-
May 20th, 2013, 11:29 PM
#1
Swiping in C#
I'm trying to support a swiping gesture in a Windows Store App written in C# and XAML.
I've a bunch of objects on a page and I want to know when the person swipes their finger over the objects or runs the mouse over them.
I can capture the mouse easily enough by checking for the mouse entering the control. What I've not figured out is the event for doing the same with a finger swipe. I was actually surprised that the mouse event wasn't kicked off with a finger swipe.
Does anyone know the proper event handler for a finger swipe over a control such as a set of buttons?
Thanks!
-
May 22nd, 2013, 11:05 PM
#2
Re: Swiping in C#
Here is code that catches the mouse pointer going over a button:
Code:
private void btn9999_PointerEntered(object sender, RoutedEventArgs e)
{
Button tmp = new Button();
tmp = (Button)sender;
tmp.Background = new SolidColorBrush(CurrentColor);
if (borderson == false)
{
tmp.BorderBrush = tmp.Background;
}
}
That captures the event of the pointer moving over the control. This works for dragging the mouse around the screen. What I'm trying to figure out, however, is how to kick off an event on a touch screen if the finger drags across the same button. Anyone have an idea or do I need to try a few more searches?
Thanks!
-
May 23rd, 2013, 12:41 AM
#3
-
May 23rd, 2013, 03:26 AM
#4
Re: Swiping in C#
If I remember correctly, you could use Pointer notifications
http://msdn.microsoft.com/library/wi...#create_the_ui
I hope this helps.
-
May 23rd, 2013, 05:33 PM
#5
Re: Swiping in C#
I'm typing this on my phone, so it's kinda ad hoc, and I didn't consult the docs, but I have an idea - might be helpfull. I'm guessing that the problem is that the pointer touches the containing ui element, and then child elements do not get pointer event notifications (similar to how child controls don't get notifications after a mouse down event occurs on the parent, until a mouse up event happens). So, if you can detect a touch, and a release on the container (and maybe also on the first and the last button), you can get two points - a line that describes the swipe (you may need to convert coordinates to parent-space). You can then check if the line intersects an (axis-aligned) bounding rectangle encompassing all the buttons (say, using the separating axis theorem, treating the line segment as an infinitely thin rotated rectangle).
Last edited by TheGreatCthulhu; May 23rd, 2013 at 05:35 PM.
-
May 23rd, 2013, 11:17 PM
#6
Re: Crystal Report Multi page prob.
Hi TheGreatCthulhu,
Thanks for ur advice. But take it clear, m working on Crystal Report 2011. i never using c# and all. So other than that if u have any idea please share .
Thank you
-
May 23rd, 2013, 11:41 PM
#7
Re: Crystal Report Multi page prob.
Originally Posted by vinothnatarajan
Hi TheGreatCthulhu,
Thanks for ur advice. But take it clear, m working on Crystal Report 2011. i never using c# and all. So other than that if u have any idea please share .
Thank you
If you have a question, post a new topic, and please don't highjack an existing thread. Thanks.
-
May 24th, 2013, 05:04 AM
#8
Re: Crystal Report Multi page prob.
Originally Posted by Arjay
If you have a question, post a new topic, and please don't highjack an existing thread. Thanks.
Hi Arjay!
This is the second time he did this in this thread. yesterday he did the same and I eventually moved his post to its own thread here :
http://forums.codeguru.com/showthrea...37241-Printing
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|