How can I create a finger scrollable Textbox in WM 6.5? - c#

I just noticed something weird in WM 6.5 emulators. Unlike 6.1 where finger panning kind of worked, the only way to scroll a Textbox appears to be through scrollbars.
This behaviour is in contrast to what they have done for comboboxes: they are now gesture-friendly without the programmer's intervention. I.e. the user can select a choice from a standard drop down menu by panning and scrolling. Previously, you had to use the embedded scrollbar. The combobox's case implies that MS took some measures to provide standard gesture support for classic finger gestures, yet I cannot see something similar for textboxes. This makes me ask the following:
Is there anything that can be done to make textboxes finger scrollabe easily?
Note that I refer to managed .NET CF development. It is my understanding that in native development I could use the new Gestures API to achieve the scrolling effect. Yet, I am not sure if there is an easier and more straightforward method that I have missed.

Create a textarea and limit it to two rows: one for text, one for a scrollbar.

You could try using the gesture api, there are managed wrappers for it...
http://blog.markarteaga.com/CategoryView,category,Samples.aspx

Related

How to implement scrollviewer bouncing's animation in c# and wpf?

I want to implement scrollviewer bouncing's animation in c# and wpf, like IOS's UIScrollview.
When users scroll to top or end, it starts to decrease speed and bouncing.
I think that google can search related issues, but i can not find.
Does anyone have similar experiences?
Well for touch manipulation, WPF already has some built in support for this. Take a look at the ReportBoundaryFeedback method and ManipulationBoundaryFeedback event. I believe the ScrollViewer automatically uses this when touch panning (see PanningMode).

How to change ListView background image layout?

I've tried to find a way to change the layout of the background image on the ListView control.
I've searched around but haven't got any straight answer.
I can see that there is a ListView property BackgroundImageLayout which is supposed to do the job. But when i change it nothing really happens beside that the BackgroundImageLayoutChanged event is triggered.
How it is possible to change the BackgroundImageLayout on the ListView control? Is there any possible workaround to achive my goal?
PS.: I know about 3rd party controls that 'fix' this problem, but I'm looking for a solution that would do the task without any additional components.
ListView is a native Windows control. Yes, it does support a background image, the LVM_SETBKIMAGE message takes care of it. It however doesn't support the boilerplate Winforms BackgroundImage support, notable lacking is BackgroundImageLayout, the property that Winforms implements for the Control class and implements when the ControlStyles.UserPaint is turned on. It is not for native Windows controls, they paint themselves.
The guy that wrote the Winforms wrapper class for ListView did the next best thing, he added a new property to the ListView class called BackgroundImageTile. A layout option that the native Windows control does implement. Which leaves you with just the two layout options that the native control supports. Tile or don't tile.
That same guy did some pretty heroic things to make the Winforms wrapper class behave reasonably. The code is filled with hacks to work around the native control's quirks. Awesome work. His life would have been a lot easier if the Windows team guy would have the luxury to make the Winforms guy's life easier. But it doesn't work that way, ListView has been around a lot longer than Winforms. And wasn't designed that well from the getgo, Microsoft had pretty significant growing pains around that time.
Fast forward and change the rules so you don't depend on legacy code: WPF, Silverlight, WinRT.
According to the MSDN, 'ListView.BackgroundImageLayout Property':
"The API supports the .NET Framework infrastructure and is not
intended to be used directly from your code."
and
This property has no effect on the layout of the background image of the ListView control, therefore it is not shown in the designer or by IntelliSense.
Use the BackgroundImage property to set the background image. See msdn for more info:
That is unless you have something fancy you are trying to do with it?
EDIT: As per a previous thread HERE: the short answer is that you can't. =(
If you desparately want it, try creating a blank image that is the dimensions of your ListView. Add to this image YOUR image and add at it a position that is in the middle. There may be something similar in nature to this in under Bitmaps or Images.

Is there a simple way to handle Touch events like Flick in WPF4?

I'm building a windows 7 touch app and want to be able to handle touch gestures as simple events, specifically flicks. I can see windows responding, it pops up the icons as I flick but I can't seem to find an easy way to handle them. Something like grid.OnLeftFlick ...
Am I missing something stupidly simple? Is there a toolkit or something I can use? Or, do I have to write my own listener?
Thanks.
While WPF4 does support multi-touch, it does not have any built in gesture support, at least not of the kind you are thinking about. Features such as flick, pinch-zoom, etc. all have to be programmed on top of WPF4.
I don't know of any higher-level gesture support toolkits but writing your own is not as hard as it sounds. This WPF4 touch sample shows for example touch based move, pinch-zoom and pinch-rotate:
Walkthrough: Creating Your First Touch Application
If you compile and run the sample you'll see the handlers are only ten to twenty lines of code and make use of powerful infrastructure in the touch API itself and core WPF features such as transformation matrices. The touch API supports inertia, etc. so try your hand at a flick that meets your needs.
Also, of course, this sample only works with Pen and Touch input devices, not an ordinary mouse, but you specified that your are developing a touch application.

C# - Winforms - Animated Slideshow

Well i am developing an application whose interface requires an animated slide show
and by animated slide show i means UI components placed together change their positions after regular intervals in a sliding (animated) fashion. Let me illustrate my idea with the following image,
(source: deviantart.com)
in the image above there are three columns of UI components that i want to slide, what i could do is simply write a module to change x,y coordinates of the components that would give the animated slide effect but that does not work fine, because it is heave takes time in processing and all plus the coding will be complex and layer adjustment and all.
is there any slide show component on which instead of image i can place UI components
What are the other options i have or what is the right way to do it. Please need help.
Sounds like are looking for a carousel feature for you component. Winforms were not intended to be animated. Fortunately some companies have worked on products that support animaiton in this area but most are moving to the Silverlight and WPF platforms for those updated features. As a reader of MSDN Magazine I often come accross some interesting advertisements of Winform components that are quite interesting. Please take a look at this link. The cost of the product is quite high.
Telerik Sample Applications using Carousel feature in Win Forms
Also check out the following link to MSDN. It explains how you can reference the silverlight component as a COM object.
Using Silverlight in a Windows based application using COM
In this scenerio it could also be possible to embed a flash player with a flash animation, using one of the many (commercial and free) xml-based slideshows avaible for flash. This one for example http://www.flshow.net/.

Good panel interface component for C#?

Any nice Paneled user interface component COM/ActiveX/Source-code for C#/VB?
Like what VS has internally:
Dock to screen edges
Slide open/close (unpinned)
Pin open
Group in tabs
And if possible, open-source/free.
Well, because otherwise I'd have to develop an interface system myself.
DockPanel Suite! Its an open-source docking library for .NET Windows Forms development which mimics Visual Studio .NET.
We use the DevExpress (devexpress.com) Component Suite, which has a Docking Manager that does that sort of thing.
I've just been evaluating a few.
Crownwoods DotNet Magic (Discontinued Product)
This has been around for a long time, and was initially one of the best docking managers out there, but its a bit long in the tooth now, we had quite a few crashes, it doesn't allow floating windows to be docked vertically and horizontally, and the tooltips on the tabs have a habit of hanging around.
Telerik
Visually great, but there a quite a few bugs in it, and its got a pretty big foot print (8MB). The event model is a bit difficult to work with as well. I integrated this into our application, only to discard the changes.
Actipro
I recon this is the best of the 3, it supports all the functionality you would expect, and I didn't come across any bugs. It doesn't look quite as good as the Telerik stuff, but at least it works properly, with a sensible object model and event structure.
OpenTheme is too fancy with styling support, but not paneled.

Categories