Telerik blogs

In a world where the word ‘touch’ became something usual rather than something exceptional, we understand that you will surely need to take your Windows Forms application to the next level. With the introduction of the Touch API in Windows 7 and the touch oriented devices for Windows 8, Microsoft paved the road to the touch-friendly applications.

We also decided to follow this path allowing you to create new or update your existing Windows Forms applications making them follow the latest UX touch trends. One step in this direction is the new RadPanorama control which we discussed in a previous blog.

The second step which you may find even more important is the full multi-touch support that the RadControls for WinForms suite will provide. We have wrapped the native touch API of Windows 7 and Windows 8 and exposed a powerful API that will allow you to enhance your Windows Forms application in a way you have never thought of before. To put it simple, you will be notified when pan, zooming and rotating touch operations occur to your RadControls, so that you can handle these notifications and process them accordingly. And since a video is worth a thousand words, let me introduce you a short demo of what you will be able to do in Q3 2011: 

Pan scrolling operations in RadListView, RadTreeView, RadGridView and RadListControl are supported out-of-the-box. In RadGridView you can also reorder columns and group your records by a single slide operation.

In case you need further enhancements, RadControl and RadElement, the base elements of the Telerik Presentation Framework, expose a number of events that are fired when the corresponding touch operation occurs on the screen. For example, for the operations that you see in the PhotoViewer application, you need to handle PanGesture, RotateGesture and ZoomGesture events. Here is a sample of the ZoomGesture handling:

void imageItem_ZoomGesture(object sender, ZoomGestureEventArgs e)
{
     PhotoElement element = sender as PhotoElement;
  
     element.ScaleTransform = new System.Drawing.SizeF(element.ScaleTransform.Width * (float)e.ZoomFactor, element.ScaleTransform.Height * (float)e.ZoomFactor);
  
     PointF oldDir = new PointF(this.Location.X - e.Center.X, this.Location.Y - e.Center.Y);
     PointF newDir = new PointF(oldDir.X * (float)e.ZoomFactor, oldDir.Y * (float)e.ZoomFactor);
     PointF offset = new PointF(newDir.X - oldDir.X, newDir.Y - oldDir.Y);
  
     this.Location = new Point(this.Location.X + (int)offset.X, this.Location.Y + (int)offset.Y);
}

 

What about Vista and XP?

You can ask this question and you will be right. Unlike Windows 7 and Windows 8, Windows Vista and Windows XP do not provide native touch API which we can handle. However, we appreciate the fact that some of your end-users may still use these Operating Systems. While we can’t simulate Zoom and Rotate features just because the Operating System does not support them, we added a pan scrolling feature (a.k.a. Kitenic Scrolling) for RadGridView, RadListView, RadListControl and RadTreeView. This feature will allow your end-users to scroll the records in these controls without having to look for a scroll-bar.

We hope that you will like the new features, and as always, your feedback is highly appreciated.

 

Download RadControls for WinForms by Telerik


About the Author

Nikolay Diyanov

Diyanov is the Product Manager of the Native Mobile UI division at Progress. Delivering outstanding solutions that make developers' lives easier is his passion and the biggest reward in his work. In his spare time, Nikolay enjoys travelling around the world, hiking, sun-bathing and kite-surfing.

Find him on Twitter @n_diyanov or on LinkedIn.

Related Posts

Comments

Comments are disabled in preview mode.