Copying from a textbox with IgnoreKey

Discussion in 'Questions (Windows Mobile)' started by BjornF, Mar 10, 2008.

  1. BjornF

    BjornF Active Member Licensed User

    I have a textbox with a content which I want to protect from accidental changes. For this I am using a text box with IgnoreKey.

    However I would also like the user to be able to copy parts from that text. Unfortunately the IgnoreKey also makes the textbox ignore ctrl-C (although you can mark text with shift-arrow). Is there any easy solution to this that I have overlooked?

    all the best / Björn
  2. Filippo

    Filippo Expert Licensed User

  3. BjornF

    BjornF Active Member Licensed User



    Sorry, of course all you need to do is right click and then save... / Björn

    Filippo - that is very neat, I'll put that in as well (just for us who don't know how to use the right click), thanks
  4. Leginus

    Leginus Member Licensed User

    You can do it by creating your own copy and paste buttons and using the selstart and sellength property. Example attached

    Sub Globals
    'Declare the global variables here.
    Dim CopyText
    End Sub

    Sub App_Start
    End Sub

    Sub TextBox1_KeyPress (key)
    End Sub

    Sub btnCopy_Click
    End Sub

    Sub btnPaste_Click
    End Sub
  5. BjornF

    BjornF Active Member Licensed User

    Thank you Leginus,
    I can see that that is also a way of doing it, it's just that I'm a firm believer of standardisation and when you have learned that Ctrl-C copies the text in almost all applications it is very frustrating to encounter one in which it does not. ;)

    I think Filippo's ReadOnly mode for the textbox is exactly what I was after.

    all the best / Björn
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice