How can i focus a popup menu ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

could you tell me how can i enable/disabel and focus a choice into a popup
menu?
i can focus the menu bar and enable/disable a choice but i didn't find any
for popups menus.
 
It doesn't appear that one can set focus to an item on a pop-up menu, but one
can enable and disable items on the pop-up menu. To enable the first item of
a popup menu, try:

Application.CommandBars("MyPopUpMenu").Controls.Item(1).Enabled = True

To disable it, try:

Application.CommandBars("MyPopUpMenu").Controls.Item(1).Enabled = False

.. . . where MyPopUpMenu is the name of the shortcut menu.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
What do you mean by enable/disable and focus a choice? What effect are
you trying to acheive?
 
Dear sir,
Thank you for the answer but this answer works with menus.
Description of problem....
I have already a menu with the choice "file" and when the user click it, it
displays a submenu with other choices
..My problem is how can i disable a choice of the 4 next choices through the
choice "File".
e.g. I want to disable the choice "save" which is in a submenu of the choice
"file", (when the user click first then menu "File" then i want the choice
"Save" of the submenu "File" to be disable).
 
Try (watch out for word wrap, as this is all one line):

Application.CommandBars("MyPopUpMenu").Controls.Item("File").Controls.Item("Save").Enabled = False

.. . . where MyPopUpMenu is the name of the pop-up menu, File is the name of
one of the items on this pop-up menu, and Save is the name of one of the
items on the submenu of the File item of the pop-up menu that you want to
disable.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Mr Camaro thank you for your help.

I think that is the same.. command if i try to change the picture of the
submenu (File_>Save (Picture).
 
So you have more than one File -> Save submenu on your pop-up menu? Or do
you have multiple items on the File menu that, when picked, show another
submenu with "Save" as one of the items?

If it's the former, then you can use the ordinal value to specify exactly
which submenu on the File menu needs to be disabled. For example (watch out
for word wrap, as this is all one line):

Application.CommandBars("MyPopUpMenu").Controls.Item("File").Controls.Item(4).Enabled = False

.. . . where the File -> Save submenu you want to disable is the fourth item
on the File menu.

If it's the latter, then you can use the name of the item on the File menu
that needs to be selected before the Save item is displayed. For example
(watch out for word wrap, as this is all one line):

Application.CommandBars("MyPopUpMenu").Controls.Item("File").Controls.Item("Template").Controls.Item("Save").Enabled = False

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Back
Top