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. Forceful use of My.Computer.Keyboard.CtrlKeyDown set to true from Edit Menu

Forceful use of My.Computer.Keyboard.CtrlKeyDown set to true from Edit Menu

Scheduled Pinned Locked Moved Visual Basic
question
11 Posts 4 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.
  • F for1206

    Hi CP , I am using My.Computer.Keyboard.CtrlKeyDown in a code , if from keyboard Ctrl key + A is done then My.Computer.Keyboard.CtrlKeyDown - True & i am doing some function. Working Fine. Suppose if from Edit Menu - Select All then how can i project My.Computer.Keyboard.CtrlKeyDown -- (have to be True) due to its False i am not getting the functionality. Regards,

    For1206

    D Offline
    D Offline
    Dave Kreskowiak
    wrote on last edited by
    #2

    I don't think anyone here has any clue what you're talking about. Show the code you're using and we might be able to figure out what you're talking about.

    A guide to posting questions on CodeProject[^]
    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
         2006, 2007, 2008
    But no longer in 2009...

    1 Reply Last reply
    0
    • F for1206

      Hi CP , I am using My.Computer.Keyboard.CtrlKeyDown in a code , if from keyboard Ctrl key + A is done then My.Computer.Keyboard.CtrlKeyDown - True & i am doing some function. Working Fine. Suppose if from Edit Menu - Select All then how can i project My.Computer.Keyboard.CtrlKeyDown -- (have to be True) due to its False i am not getting the functionality. Regards,

      For1206

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #3

      This is not the way to link menu items with keyboard shortcuts, as far as I know. In C++ projects it's done by settings in the resource script, and I guess there must be something similar in VB. Maybe properties of the menu item. btw I've changed the subject line in the hope that one of the VB experts who know the answer, will spot this.

      txtspeak is the realm of 9 year old children, not developers. Christian Graus

      1 Reply Last reply
      0
      • F for1206

        Hi CP , I am using My.Computer.Keyboard.CtrlKeyDown in a code , if from keyboard Ctrl key + A is done then My.Computer.Keyboard.CtrlKeyDown - True & i am doing some function. Working Fine. Suppose if from Edit Menu - Select All then how can i project My.Computer.Keyboard.CtrlKeyDown -- (have to be True) due to its False i am not getting the functionality. Regards,

        For1206

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #4

        Are you talking about the MenuItem.Shortcut[^] property?? You don't have to use My.Computer.Keyboard.anything to use this property.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008
        But no longer in 2009...

        1 Reply Last reply
        0
        • F for1206

          Hi CP , I am using My.Computer.Keyboard.CtrlKeyDown in a code , if from keyboard Ctrl key + A is done then My.Computer.Keyboard.CtrlKeyDown - True & i am doing some function. Working Fine. Suppose if from Edit Menu - Select All then how can i project My.Computer.Keyboard.CtrlKeyDown -- (have to be True) due to its False i am not getting the functionality. Regards,

          For1206

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #5

          You can register you Key to as a HOT KEY. then you can use it.

          If you can think then I Can.

          F 1 Reply Last reply
          0
          • L Lost User

            You can register you Key to as a HOT KEY. then you can use it.

            If you can think then I Can.

            F Offline
            F Offline
            for1206
            wrote on last edited by
            #6

            Thanks for reply , suppose from keyboard i pressed CTRL + A then i am doing functionality to select the controls on the panel by checking IF My.Computer.Keyboard.CtrlKeyDown then -- some functionality End If CTRL + A --- SelectAll in EDIT MENU in menubar This menu item is clicked then how can i forcefully IF My.Computer.Keyboard.CtrlKeyDown then its in false but how to make true -- some functionality End If -- the condition is linked with this one . regards,

            For1206

            M L 2 Replies Last reply
            0
            • F for1206

              Thanks for reply , suppose from keyboard i pressed CTRL + A then i am doing functionality to select the controls on the panel by checking IF My.Computer.Keyboard.CtrlKeyDown then -- some functionality End If CTRL + A --- SelectAll in EDIT MENU in menubar This menu item is clicked then how can i forcefully IF My.Computer.Keyboard.CtrlKeyDown then its in false but how to make true -- some functionality End If -- the condition is linked with this one . regards,

              For1206

              M Offline
              M Offline
              Mark Hurd
              wrote on last edited by
              #7

              I believe you're saying My.Computer.Keyboard.CtrlKeyDown is not reflecting the Control key state during a Click event. I was not able to confirm this behaviour: that is the CtrlKeyDown reflected the state of the Control key for me using both MenuItem and ToolStripMenuItem. Regards, Mark Hurd, B.Sc.(Ma.) (Hons.)

              1 Reply Last reply
              0
              • F for1206

                Thanks for reply , suppose from keyboard i pressed CTRL + A then i am doing functionality to select the controls on the panel by checking IF My.Computer.Keyboard.CtrlKeyDown then -- some functionality End If CTRL + A --- SelectAll in EDIT MENU in menubar This menu item is clicked then how can i forcefully IF My.Computer.Keyboard.CtrlKeyDown then its in false but how to make true -- some functionality End If -- the condition is linked with this one . regards,

                For1206

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #8

                I am not able to meaning of your question. But if you want to Use Ctrl + A to without using keypress then you have three ideas 1 : You can use HOT KEY By using Registerhotkey 2 : You Can use sendkeys option 3 : You can Use Keyboard Hook for doing this operation. ok

                If you can think then I Can.

                F 1 Reply Last reply
                0
                • L Lost User

                  I am not able to meaning of your question. But if you want to Use Ctrl + A to without using keypress then you have three ideas 1 : You can use HOT KEY By using Registerhotkey 2 : You Can use sendkeys option 3 : You can Use Keyboard Hook for doing this operation. ok

                  If you can think then I Can.

                  F Offline
                  F Offline
                  for1206
                  wrote on last edited by
                  #9

                  Hi , Thanks 4 reply , This is the code which i used. if in keyboard CTRL key is pressed . Working fine

                  If SelectedControls.Count > 1 And Not My.Computer.Keyboard.CtrlKeyDown Then

                         'Some functionality for controls like n vb.net Design Editor.         
                    Call ExHandles()
                  

                  End If

                  if from EDIT Menu -- How to make My.Computer.Keyboard.CtrlKeyDown = true i tried SendKeys -- its hanging the application .may i know how can i implement ? Regards,

                  For1206

                  L 1 Reply Last reply
                  0
                  • F for1206

                    Hi , Thanks 4 reply , This is the code which i used. if in keyboard CTRL key is pressed . Working fine

                    If SelectedControls.Count > 1 And Not My.Computer.Keyboard.CtrlKeyDown Then

                           'Some functionality for controls like n vb.net Design Editor.         
                      Call ExHandles()
                    

                    End If

                    if from EDIT Menu -- How to make My.Computer.Keyboard.CtrlKeyDown = true i tried SendKeys -- its hanging the application .may i know how can i implement ? Regards,

                    For1206

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #10

                    I have some Ideas which i already pass to you. Then you should implement it now. And your Code is not properly for getting the meaning of your query?

                    If you can think then I Can.

                    F 1 Reply Last reply
                    0
                    • L Lost User

                      I have some Ideas which i already pass to you. Then you should implement it now. And your Code is not properly for getting the meaning of your query?

                      If you can think then I Can.

                      F Offline
                      F Offline
                      for1206
                      wrote on last edited by
                      #11

                      Hi Anubava, There is nothing in my query . Only a small query . on the form there are some ctrls like at design time . On using of CTRL keypress i am selecting the control one by one . Suppose if i select the EDIT Menu -- SelectAll (CTRL + A) then i have to select all the controls present on the form . I have achieved this one using a boolean variable . My idea is to not using of boolean variable & setting the Keyboard.CTRL to true by using some technique .. Regards,

                      For1206

                      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