Re: ContextMenuStrip and PreviewKeyDown
- From: jetan@xxxxxxxxxxxxxxxxxxxx ("Jeffrey Tan[MSFT]")
- Date: Tue, 06 Feb 2007 06:39:37 GMT
Hi Dave,
Thanks for your feedback!
Yes, in this little sample project, I did not move the MyContextMenuStrip
code into a separate control, so I just modified the original designer
generated code manually.
In practical using, you may move the code into a separate control, and once
your control contains a constructor with the prototype below:
public MyContextMenuStrip(IContainer container)
The designer will understand it and generate the code to call this special
constructor:
this.myContextMenuStrip1 = new
ContextMenuStripTest.MyContextMenuStrip(this.components);
The article below provides more details of the context of this constructor:
"What's that "Windows Form Designer generated code" anyway?"
http://www.codeproject.com/dotnet/disposable_components.asp?print=true
I have also modified the original project to place the MyContextMenuStrip
code into a separate control. I have attached this sample project in this
reply, for your information.
Hope it helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Attachment:
ContextMenuStripTest.zip
Description: Binary data
- Follow-Ups:
- Re: ContextMenuStrip and PreviewKeyDown
- From: Dave
- Re: ContextMenuStrip and PreviewKeyDown
- References:
- RE: ContextMenuStrip and PreviewKeyDown
- From: "Jeffrey Tan[MSFT]"
- Re: ContextMenuStrip and PreviewKeyDown
- From: Dave
- Re: ContextMenuStrip and PreviewKeyDown
- From: "Jeffrey Tan[MSFT]"
- Re: ContextMenuStrip and PreviewKeyDown
- From: Dave
- Re: ContextMenuStrip and PreviewKeyDown
- From: "Jeffrey Tan[MSFT]"
- Re: ContextMenuStrip and PreviewKeyDown
- From: Dave
- RE: ContextMenuStrip and PreviewKeyDown
- Prev by Date: Extracting innertext and attribute using XmlSerializer
- Next by Date: Re: About C# Generic
- Previous by thread: Re: ContextMenuStrip and PreviewKeyDown
- Next by thread: Re: ContextMenuStrip and PreviewKeyDown
- Index(es):
Relevant Pages
|