Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Key board shortcut Control C

Key board shortcut Control C

Scheduled Pinned Locked Moved Visual Basic
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Prakash_Mishra
    wrote on last edited by
    #1

    can we write a code in vb which is equivalent to control c keyboad action, If yes pl provide me the code

    Prakash Mishra(Banglore,India)

    H T 2 Replies Last reply
    0
    • P Prakash_Mishra

      can we write a code in vb which is equivalent to control c keyboad action, If yes pl provide me the code

      Prakash Mishra(Banglore,India)

      H Offline
      H Offline
      helelark123
      wrote on last edited by
      #2

      'Set form1 keypreview property to true' 'Add 2 labels Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.Control And e.KeyCode = Keys.C Then Clipboard.Clear() Clipboard.SetText(label1.text) End If If e.Control And e.KeyCode = Keys.V Then Label2.Text = Clipboard.GetText() End If End Sub

      Shay Noy

      1 Reply Last reply
      0
      • P Prakash_Mishra

        can we write a code in vb which is equivalent to control c keyboad action, If yes pl provide me the code

        Prakash Mishra(Banglore,India)

        T Offline
        T Offline
        Tom Deketelaere
        wrote on last edited by
        #3

        you want to copy certain text I presume. this will usualy work without any code (if windows is the OS) if you want another action to happen you'll need to catch the keydown event and check wether the control key and the c key are pressed. Another way (perhaps better/easier) is to add a menustrip to you'r form (put it invisible) and then in code (or design):

        Dim mnuselectie As New ToolStripMenuItem("selectie")
        mnuselectie.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.C), System.Windows.Forms.Keys)
        AddHandler mnuselectie.Click, AddressOf mnuselectie_Click
        msAlgemeen.Items.Add(mnuselectie) 'msalgemeen=menustrip on the form

        then add code to mnuselectie_click hope this helps

        If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistaks.

        P 1 Reply Last reply
        0
        • T Tom Deketelaere

          you want to copy certain text I presume. this will usualy work without any code (if windows is the OS) if you want another action to happen you'll need to catch the keydown event and check wether the control key and the c key are pressed. Another way (perhaps better/easier) is to add a menustrip to you'r form (put it invisible) and then in code (or design):

          Dim mnuselectie As New ToolStripMenuItem("selectie")
          mnuselectie.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.C), System.Windows.Forms.Keys)
          AddHandler mnuselectie.Click, AddressOf mnuselectie_Click
          msAlgemeen.Items.Add(mnuselectie) 'msalgemeen=menustrip on the form

          then add code to mnuselectie_click hope this helps

          If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistaks.

          P Offline
          P Offline
          Prakash_Mishra
          wrote on last edited by
          #4

          hi I want to perform a the action like 1) select a file. 2)click the button ( here i want to perform 3 actions CntrlA + CntrlC + CntrlV) that is select all + Copy + Paste. 3) The output will get paste in a specified word file. So i want on a button click these 3 action to get performed. Pl help

          Prakash Mishra(Banglore,India)

          T 1 Reply Last reply
          0
          • P Prakash_Mishra

            hi I want to perform a the action like 1) select a file. 2)click the button ( here i want to perform 3 actions CntrlA + CntrlC + CntrlV) that is select all + Copy + Paste. 3) The output will get paste in a specified word file. So i want on a button click these 3 action to get performed. Pl help

            Prakash Mishra(Banglore,India)

            T Offline
            T Offline
            Tom Deketelaere
            wrote on last edited by
            #5

            I'll need a bit more information to answer this the file is in wich format?? the file is on the hdd and you select it in you're programme or just in windows explorer?? the word file is specified in you're programme?? all the actions have to perform in sequence without any further user input?? you work with a button or a shortcut?? once the button is pressed you know the filepath and the word path??

            If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistaks.

            P 1 Reply Last reply
            0
            • T Tom Deketelaere

              I'll need a bit more information to answer this the file is in wich format?? the file is on the hdd and you select it in you're programme or just in windows explorer?? the word file is specified in you're programme?? all the actions have to perform in sequence without any further user input?? you work with a button or a shortcut?? once the button is pressed you know the filepath and the word path??

              If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistaks.

              P Offline
              P Offline
              Prakash_Mishra
              wrote on last edited by
              #6

              thanks lot for your patience. 1)the action ( CntolA + ControlC) i want o perform on a pdf file 2)I want to create a browse button which will give the path of the pdf file)I think i have to open the file before performing the CntolA + ControlC action. 3)Then the i want a button say the name is action ( which will perform the events sequentially select all(pdf) + Copy + Paste(in word) Hope i am clear to u this time Regards

              Prakash Mishra(Banglore,India)

              T 1 Reply Last reply
              0
              • P Prakash_Mishra

                thanks lot for your patience. 1)the action ( CntolA + ControlC) i want o perform on a pdf file 2)I want to create a browse button which will give the path of the pdf file)I think i have to open the file before performing the CntolA + ControlC action. 3)Then the i want a button say the name is action ( which will perform the events sequentially select all(pdf) + Copy + Paste(in word) Hope i am clear to u this time Regards

                Prakash Mishra(Banglore,India)

                T Offline
                T Offline
                Tom Deketelaere
                wrote on last edited by
                #7

                in the button action you'll need to do the following: access the pdf file (don't know for shure but I think you need a component for it and it's not cheap) these articles might be of help for this: http://www.codeproject.com/showcase/TallComponents.asp[^] http://www.codeproject.com/cs/library/iTextSharpTutorial.asp[^] once you can read the pdf file you should be able to select everything then you can add it to the clipboard: Clipboard.SetText(pdf.selectedtext(or somthing)) then you'll need to open the word file (there are enough examples about this) and paste the text: word = Clipboard.GetText() some articles for help: http://www.codeproject.com/office/DocumentMaker.asp[^] http://www.codeproject.com/office/WordInDotnet.asp[^] hope this helps

                If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistaks.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups