locked
hotkey to call a item inside the listview RRS feed

  • Question

  • hi,

    i don't know it's possible ..but i want to create a hotkey to call a item inside the listview, is it possible?

    i already found a function "RegisterHotKey" but this works to call forms and i need a hotkey to call a component inside the form.

    please nobody knows how can i do this?

    i use "visual studio 2005" and vista. tks

    Friday, January 15, 2010 8:19 PM

Answers

  • Hm, you may rather work on ole extensions. I mean one or two or three you can work with separate VB product, this or that way, but you may recieve much larger cooperation of your tool extension and msword when you make native extension to word (the same as different toolbars / BHO work with internet explorer)

    http://www.codeproject.com/KB/COM/outlookaddin.aspx !!
    (http://www.codeproject.com/KB/miscctrl/Excel_data_access.aspx)

    but if you really suffice with hotkey, you were really "on the place" with your thread-title. Because KeyUp can't really be recieved when another window / app is on focus. It's even more easy to implement hotkeys, than to implement BHO/addin, but advantages of addin are still considerable for you (you can modify menu of symbious application - word in your case, and you can do another things like that, which you can't with standalone project). just properly calculate your priorities, considering pluses or minuses, not regarding time-costs, if this is possible for you.

    Just tell if you decide for hotkeys. There is lots of answered threads on this topic here (and everywhere).

    Best regards, Matt

    If a <> b Then MsgBox(a): MsgBox(b) Else MsgBox(a) : End
    See also: 1, 2, 3, 4, 5, :)
    • Marked as answer by Jeff Shan Friday, January 22, 2010 7:52 AM
    Monday, January 18, 2010 8:05 PM

All replies

  • Not sure what "call a item" means?

    1.  Please explain "call a item" in more detail.
    2.  Please explain whether the key needs to work all the time or only when your application has focus.
    Saturday, January 16, 2010 4:19 PM
  • I am not sure if hotkey is what you really need. Because hotkey is uniform term for keyboard shortcut, possible to call from anywhere in system (in meaning "from each active window"). You may suffice with KeyUp or KeyPress events.

    Sub ListView1_KeyUp(Sender As Object, e As KeyEventArgs) Handles ListView1.KeyUp
     If e.KeyCode = Delete Then ListView1.Items.Remove(ListView1.SelectedItems(0))
    End Sub
    Best wishes, Matt
    If a <> b Then MsgBox(a): MsgBox(b) Else MsgBox(a) : End
    See also: 1, 2, 3, 4, 5, :)
    Sunday, January 17, 2010 3:17 AM
  • thank you for answers ....

    BinaryCoder : 

     1. I want to create a keyboard shortcut to simulate the ListView1.Click event.

          I saw something ( i guess) similar to this ...when you write some word in microsoft.word you can select the paragraph and click "Ctrl + N" to put a bold.

          the idea is the same ..... a shortcut to simulate the event "onClick".

     2. the key needs to work all the time .

    I hope I have to explained better.


    konikula:

    i like so much your tip ...

    My form was created to extend the tools to word , i want to work with the focus in word document and when i click a shortcut i simulate a function in vb.

    Will work ListView1.KeyUp event whether the focus is in word?

    Monday, January 18, 2010 1:38 PM
  • Hm, you may rather work on ole extensions. I mean one or two or three you can work with separate VB product, this or that way, but you may recieve much larger cooperation of your tool extension and msword when you make native extension to word (the same as different toolbars / BHO work with internet explorer)

    http://www.codeproject.com/KB/COM/outlookaddin.aspx !!
    (http://www.codeproject.com/KB/miscctrl/Excel_data_access.aspx)

    but if you really suffice with hotkey, you were really "on the place" with your thread-title. Because KeyUp can't really be recieved when another window / app is on focus. It's even more easy to implement hotkeys, than to implement BHO/addin, but advantages of addin are still considerable for you (you can modify menu of symbious application - word in your case, and you can do another things like that, which you can't with standalone project). just properly calculate your priorities, considering pluses or minuses, not regarding time-costs, if this is possible for you.

    Just tell if you decide for hotkeys. There is lots of answered threads on this topic here (and everywhere).

    Best regards, Matt

    If a <> b Then MsgBox(a): MsgBox(b) Else MsgBox(a) : End
    See also: 1, 2, 3, 4, 5, :)
    • Marked as answer by Jeff Shan Friday, January 22, 2010 7:52 AM
    Monday, January 18, 2010 8:05 PM
  • >  I saw something ( i guess) similar to this ...when you write some word in microsoft.word you can select the paragraph and click "Ctrl + N"

    Please clarify your answer as to "the key needs to work all the time".  The Microsoft Word Ctrl+B certainly does not work this way.  If you leave Microsoft Word and go to Microsoft Paint, the Ctrl+B is not handled Microsoft Word because Microsoft Word is not the active application.

    Also, a ListView might have more than one item.  Do you want the key to cause a specific item to be selected, or do you just want to act on the item that is already selected.

    How about giving a walkthrough explaining exactly what you want to happen?
    Tuesday, January 19, 2010 1:25 AM
  • hi guys,

    i found this video in youtube.  http://www.youtube.com/watch?v=dSsIaE6gjFY

    and i got it in my program.

    tks

    Luciana Silvestre

    • Proposed as answer by konikula Wednesday, February 10, 2010 12:00 PM
    Tuesday, February 9, 2010 2:56 PM
  • Thx for sharing. It's wonderful vid

    -br.m
    If a <> b Then MsgBox(a): MsgBox(b) Else MsgBox(a) : End
    See also: 1, 2, 3, 4, 5, :)
    Wednesday, February 10, 2010 12:00 PM