context menu and controls

B

Bernie Yaeger

The context menu is a form level control. Is there a way to affix a context
menu, not to the form, but rather to one of the controls instead?

Thanks for any help.

Bernie Yaeger
 
B

Bernie Yaeger

Hey, nevermind - I just read a response from Cor to another question that
answered me! Tx anyway. You just define the context menu in the property
grid of the designer to the control in question.

Bernie
 
H

Herfried K. Wagner [MVP]

Bernie Yaeger said:
The context menu is a form level control. Is there a way to affix a
context menu, not to the form, but rather to one of the controls instead?


Assign the contextmenu to the control's 'ContextMenu' property. If you need
a reference to the control the context menu was shown on, you can check the
contextmenu's 'SourceControl' property when an item was clicked.
 
B

Bernie Yaeger

Tx Herfried - I saw a post that answered the question just before you
responded.

Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top