Windows and Forms

  • Thread starter Thread starter Allen Maki
  • Start date Start date
A

Allen Maki

Hi Everybody,

I need your help.



I have MS Visual Studio .NET 2003. I noticed that if I added a context menu
to a form. It will not work, unless you add the line:



This ->ContextMenu = this->contextMenu;



manually.



Can anybody tell me why?



IF you have the book named:

Microsoft visual c++ .net step by step made by Microsoft press, you
find this example in chapter 16 page 317
 
Allen Maki said:
Hi Everybody,

I need your help.



I have MS Visual Studio .NET 2003. I noticed that if I added a context
menu to a form. It will not work, unless you add the line:



This ->ContextMenu = this->contextMenu;



manually.



Can anybody tell me why?

You can usually assign that using the designer, but yes it's necessary to
assign a specific context-menu. This is because you could store multiple
context menu controls on a form, but one is for the form itself, one is a
right-click menu for a grid, one for a text-box, etc. The runtime has no
way of knowing how they pair up until you tell it.
 
Back
Top