Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71

    Unanswered: Right Click of Mouse

    I was wondering if anyone knew how i could get a custom menu on a right mouse click in a text box. I don't even know if this is possible, but if anyone has any ideas i would very heppy :-)
    emma.

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    it's possible but i've never tried it, i'll see it i can find out how it's done
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71
    thanks. i didn't really know where to start!

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    Originally posted by emma_com
    thanks. i didn't really know where to start!
    i can tell you that much
    ShortcutMenuBar Property, just don't ask me how to use it

    the help file says:

    ShortcutMenuBar Property
    You can use the ShortcutMenuBar property to specify the shortcut menu that will appear when you right-click on a form, report, or control on a form. Read/write String.

    expression.ShortcutMenuBar

    expression Required. An expression that returns one of the objects in the Applies To list.

    Remarks
    You create these shortcut menus by pointing to Toolbars on the View menu and then clicking Customize.

    Note The ShortcutMenuBar property applies only to controls on a form, not controls on a report.

    You can also use the ShortcutMenuBar property to specify the menu bar macro that will be used to display a shortcut menu for a datasheet, form, form control, or report.

    Note In versions of Microsoft Access prior to Microsoft Access 97, you created a custom shortcut menu by setting the ShortcutMenuBar property to the name of a menu bar macro. You then created a macro group containing the commands for this menu. This functionality is still supported in Microsoft Access. However, it is strongly recommended that you use the new Customize dialog box, available by pointing to Toolbars on the View menu, and then clicking Customize, to create custom shortcut menus.

    Enter the name of the shortcut menu you want to display. A shortcut menu can be any command bar whose Type property is set to Popup. If you leave the ShortcutMenuBar property setting blank, Microsoft Access displays the built-in (default) shortcut menu or the application's global shortcut menu. If you set the ShortcutMenuBar property to a value that isn't the name of an existing shortcut menu or menu bar macro, the form, form control, or report won't have a shortcut menu (the default shortcut menu won't be shown).

    You can set this property by using the object's property sheet, a macro, or Visual Basic.

    In Visual Basic, you set this property by using a string expression that is the name of the shortcut menu you want to display.

    To display the built-in shortcut menu for a database, form, form control, or report by using a macro or Visual Basic, set the property to a zero-length string (" ").

    You create a custom shortcut menu by first creating a toolbar that includes all the commands you want to appear on your custom shortcut menu. Then open the Toolbar Properties dialog box by selecting the toolbar in the Customize dialog box and clicking the Properties button. In the Toolbar Properties dialog box, set the Type property to Popup. This toolbar will now be available in the ShortcutMenuBar property box in the property sheet for a form, form control, or report.

    When used with the Application object, the ShortcutMenuBar property enables you to display a custom shortcut menu as a global shortcut menu. However, if you've set the ShortcutMenuBar property for a form, form control, or report in the database, the custom shortcut menu of that object will be displayed in place of the database's global shortcut menu. You can display a different custom shortcut menu for a specific form, form control, or report by setting its ShortcutMenuBar property to a different shortcut menu. When the form, form control, or report has the focus, the custom shortcut menu for that object is displayed when the user clicks the right mouse button; otherwise, the global shortcut menu for the database is displayed.

    Shortcut menus aren't available to any object if the AllowShortcutMenus property is set to False.
    of cause thats still along way from being able to get it to work
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  5. #5
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71
    ok, i'll start looking at that and if you have any more thoughts id would be most grateful!

  6. #6
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    Originally posted by emma_com
    ok, i'll start looking at that and if you have any more thoughts id would be most grateful!
    no sorry the best i can do is change the built in ones, i cant get it to create new ones
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  7. #7
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71
    thanks for trying! i'll see if i can edit one into what i want it to do.

  8. #8
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    tipical the instant i admit defeat i find the answer, okay here how you do it

    go to view -> toolbars -> customize ...

    Create a tool bar with the commands you want

    then go back to the toolbars tab

    highlight the new toolbar and click properties

    and change it's type to a popup and it becomes a shortcut menu the all you have to do is put the name in the afore mention shortCutMenuBar property.

    now all i need to do is figure out how to delete the damned things now i've created it
    Last edited by m.timoney; 06-09-03 at 09:35.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  9. #9
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71
    you are a star. thank you. i will try that now.

  10. #10
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71
    that works very well...... just one more thing. one of the forms i have, right clicking just closes it. any ideas why this might be? is it just that the form is corrupt?

  11. #11
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71
    it's ok, don't worry. someone has written some stupid code behind the form to close it on right click (very useful of them!)

Posting Permissions

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