CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2000
    Posts
    29

    short cut keys for toolbars

    I used a toolbar control as buttons. The problem is unlike the command buttons, it does not support the shortcut key using ampersand. Is it possible to assign a shortcut key to the buttons i've used in my toolbar control? If yes, how? Thanks. Hope you can help me.


  2. #2
    Join Date
    May 2001
    Location
    Russia
    Posts
    200

    Re: short cut keys for toolbars

    Create menu with function as toolbar button. Give this menu needed shortcut key and all ))

    Andy Tower

  3. #3
    Join Date
    Aug 2000
    Posts
    29

    Re: short cut keys for toolbars

    i cannot use the menu because i am using images for the buttons. is there another way to create shortcut keys for the toolbar button?


  4. #4

    Re: short cut keys for toolbars

    Toolbar, itself is a shortcut for menu items. There are two shortcut ways to access menu.
    1)through Toolbar
    2)through shortcut like CTRL+N
    If you want to create shortcut(CTRL+N) for toolbar "NEW" then you must have a menu item "NEW". I don't think there is another way.


  5. #5
    Join Date
    May 2001
    Location
    Russia
    Posts
    200

    Re: short cut keys for toolbars

    I don't understand you. All program only dublucate command from menu on toolbar. Create menu and shortcut. Create toolbar and call function.

    1. Create menu "Test" in menu editor.
    2. Give shortcut for this menu
    3. Create toolbar and button.
    4. Insert code


    private Sub Test_Click()
    TestSub
    End Sub

    private Sub Toolbar1_ButtonClick(byval Button as MSComctlLib.Button)
    If Button.Index = 1 then TestSub
    End Sub

    private Sub TestSub()
    MsgBox "All work"
    End Sub




    Andy Tower

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured