C# Assign bigger images (bigger than default 16x16 icons) in ContextMenuStrip

How to set bigger images instead of the default 16x16 iconsin ContextMenuStrip.

Attached is an image - and it will explain more. The icons that are circled with red color should be changed to 48x48  icons.

How can I do that ??

Who is Participating?
waelaliConnect With a Mentor Author Commented:

I have found the solution.
In addition to
            myImages.ImageSize = new System.Drawing.Size(48, 48);

you must do the following also
            contextMenu1.ImageScalingSize = new System.Drawing.Size(48, 48);

The calling order is not important and you can put them before or after

Bob LearnedCommented:
How are you referencing the images?  Is there an ImageList?
waelaliAuthor Commented:
yes ofcourse. imagelist.
but could not resie the image susing that .
I have tried but could not see any effect-
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Bob LearnedCommented:
What is the ImageList.ImageSize set to?  It should be 48 x 48, if you have images with that size.
waelaliAuthor Commented:
i have did that but nothing was changed
waelaliAuthor Commented:
I have done the following

ImageList myImages = new ImageList();
myImages.ImageSize.Height = 48;
myImages.ImageSize.Width = 48;

but I got a compilation error:

Error 1 Cannot modify the return value of 'System.Windows.Forms.ImageList.ImageSize' because it is not a variable
May you can help??
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.