Asked by:
Manipulation on TextBox is not that smooth

Question
-
I referenced answer here to make TextBox can be manipulated. But I found there is a problem that the moving or rotating is not that smooth just like other elements. Maybe it's because the manipulate delta on textbox is too big. I am not sure and i don't know how to fix it.
Have anyone met this probelem and is there any solution?
- Edited by Jeromeee Friday, October 24, 2014 2:37 AM
Friday, October 24, 2014 2:35 AM
All replies
-
Can you please explain in more detail what you are doing, and what you mean by the moving and rotating not being smooth? Can you provide a Minimal, Complete, and Verifiable example, exact repro steps, and a clear description of the expected behaviour and how it differs from the actual behaviour?
Manipulation delta will not depend on the specific control.
--Rob
Friday, October 24, 2014 11:19 PMModerator -
Can you please explain in more detail what you are doing, and what you mean by the moving and rotating not being smooth? Can you provide a Minimal, Complete, and Verifiable example, exact repro steps, and a clear description of the expected behaviour and how it differs from the actual behaviour?
Manipulation delta will not depend on the specific control.
--Rob
I am adding a TextBox on the Canvas and i want to move and rotate and scale the TextBox with my fingers.
xaml part is like this:
<TextBox Name="txtBox" TextWrapping="Wrap" AcceptsReturn="True" ScrollViewer.ZoomMode="Disabled" ScrollViewer.VerticalScrollMode ="Disabled" ScrollViewer.HorizontalScrollMode ="Disabled" FontSize="14" Canvas.ZIndex="0" />
And the code behind is like below:
txtBox.ManipulationMode = ManipulationModes.All; txtBox.AddHandler(UIElement.TappedEvent, new TappedEventHandler(OnTextBoxTapped), true); txtBox.AddHandler(UIElement.PointerPressedEvent, new PointerEventHandler(OnTextBoxPointerPressed), true); txtBox.AddHandler(UIElement.HoldingEvent, new HoldingEventHandler(OnTextBoxfHolding), true); txtBox.AddHandler(UIElement.ManipulationStartingEvent, new ManipulationStartingEventHandler(CompManipulationStarting), true); txtBox.AddHandler(UIElement.ManipulationStartedEvent, new ManipulationStartedEventHandler(CompManipulationStarted), true); txtBox.AddHandler(UIElement.ManipulationDeltaEvent, new ManipulationDeltaEventHandler(CompManipulationDelta), true); txtBox.AddHandler(UIElement.ManipulationCompletedEvent, new ManipulationCompletedEventHandler(CompManipulationCompleted), true); txtBox.AddHandler(UIElement.ManipulationInertiaStartingEvent, new ManipulationInertiaStartingEventHandler(CompManipulationInertiaStarting), true);
All those handlers make "Handled" of EventArgs to be false to let the events to be passed up to parent elements.
What i mean not smooth is, on moving or rotating on other elements like rectangle we feel it moves continuously, but for TextBox it just don't move with small distance and a big jump if you move a long distance. It's easy to duplicate it.
Monday, October 27, 2014 1:26 AM -
Can you share a Minimal, Complete, and Verifiable example on your OneDrive? Please also include exact repro steps and a clear description of the expected behaviour and how it differs from the actual behaviour.Tuesday, October 28, 2014 12:14 AMModerator