locked
WPF TextBox's Text moves around on tapping RRS feed

  • Question

  • I have a WinRT (Windows 8.1) project where I am using a Read-only TextBox as I need to have Copy-Paste feature enabled. Problem is that when I tap on the text and drag it to right or left, the text gets moved up till a certain distance (after that it stops moving) and when I take my thumb off of the screen the text retains it's original position. When I replace my TextBox with TextBlock it seemed to have fixed this issue but I can't do that as I need to have Copy/Paste feature for that text. A simple textbox like this can be tested to reproduce the issue:

    <TextBox x:Name="Subject1" IsReadOnly="True"
                    Text="Hi I am being tested" Grid.Column="1" />
    Thursday, August 21, 2014 9:56 AM

Answers

  • I see the behavior but I don't understand why it's a problem. You're trying to drag the content, so the text moves... seems normal to me.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, August 21, 2014 7:28 PM
    Moderator
  • I think there is a lot of wasted effort involved to make a textbox not behave like a textbox. 

    Could you use a textblock and place a button next to it that actually does the copy to the clipboard?


    Darin R.

    Thursday, August 21, 2014 8:08 PM

All replies

  • I see the behavior but I don't understand why it's a problem. You're trying to drag the content, so the text moves... seems normal to me.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, August 21, 2014 7:28 PM
    Moderator
  • I think there is a lot of wasted effort involved to make a textbox not behave like a textbox. 

    Could you use a textblock and place a button next to it that actually does the copy to the clipboard?


    Darin R.

    Thursday, August 21, 2014 8:08 PM
  • Thanks Matt, I think I am going to have to live with it then. Shouldn't be a problem.
    Friday, August 22, 2014 6:24 AM
  • I can't do that Darin, since I have to enable the user to select some part of the text and copy it to the clipboard. Also, I am not in a condition to make such change in the UI of my control. Thanks anyway.
    Friday, August 22, 2014 6:26 AM