locked
Ctrl-C and Ctrl-V don't work...

    Question

  • I seem to have globally lost the Windows standard Ctrl-C (copy) and Ctrl-V (paste) functionality between the text boxes in my application. Their content is copied from, but not bound to, a database table.  It's almost as if the application/solution itself has "a switch turned off" somewhere.

    Where should I start looking please? Any ideas? The textboxes are nothing clever, and their Read Only properties are left at the default  "False".

    Thanks.

    (VB 2005 Express edition)
    Wednesday, February 28, 2007 4:45 PM

All replies

  • Did you change the ContextMenuStrip property?  I believe the TextBox gets this functionality from the default ContextMenu.

    Tony

    Wednesday, February 28, 2007 5:04 PM
  • Hi,

    You could do it with mouseDown event like this.>>

    Alternatively highlight the text you want to copy with the mouse THEN Ctrl-C then do your Ctrl-V .

    'Doing this via a GLOBAL variable means you can

    'use this text in any other Sub. :-)

    Dim pasteText As String

    'Enter some text in textbox1 and then click the mouse in textbox1

    Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown

    pasteText = TextBox1.Text

    End Sub

    'Click the mouse in textbox2 and the text is copied (pasted) from textbox1

    Public Sub TextBox2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox2.MouseDown

    TextBox2.Text = pasteText

    End Sub

     

    Regards,

    S_DS

     

    Wednesday, February 28, 2007 9:01 PM