CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2010
    Posts
    3

    Smile Is it possible to add a picture on the top of ContextMenuStrip

    Hi,

    Is it possible to add a picture above the items in a ContextMenuStrip? Or a panel on which there could be some fancy stuff like an animation?

    Many thanks!
    Martin

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Is it possible to add a picture on the top of ContextMenuStrip

    Yup, you can always write the code to do it. I have never tried to add images to a context menu strip, so maybe there is an easier way, but you can always just roll your own control by drawing it yourself and handling the mouse input.

  3. #3
    Join Date
    Jun 2010
    Posts
    3

    Re: Is it possible to add a picture on the top of ContextMenuStrip

    Hi, thanks for your advice. My idea is to use the standard menu strip control which has/will have different look in various Windows versions and add - preferably - a control-container on the top of it to display a picture / animation / a text hint etc. In the first instance I probably could draw a picture, but would be better to create something generic, and as I'm quite junior to C#/.NET hoped someone could point me to a piece of code to give me a hint.

  4. #4
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Is it possible to add a picture on the top of ContextMenuStrip

    All it takes is a little knowledge. Learn how to draw using the Graphics class, override OnPaint, etc. Pretty basic concepts, there are already many tutorials out there.

  5. #5
    Join Date
    Jun 2010
    Posts
    3

    Re: Is it possible to add a picture on the top of ContextMenuStrip

    Yup, but I haven't found anything about ContextMenuStrip hosting another control and this was actually my question - if anyone had done it before and could share a few lines of code. In my case drawing a picture is just a quick win for the time being.

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured