Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Menu, Application Menu, Context Menu > Can you set width/height for RadMenuItem image?!?

Not answered Can you set width/height for RadMenuItem image?!?

Feed from this thread
  • Russell avatar

    Posted on Mar 30, 2011 (permalink)

    Hi,

    I've been trying to add images to items in an instance of the RadMenu, and it looks like you don't allow people to set the height or width of an image that is associated with an instance of RadMenuItem? Is there a way to do this, or do you actually have to create individual images, specially sized to 16x16 or whatever, for each of your menu items?

    Thanks,

    Russ

    Reply

  • Posted on Mar 31, 2011 (permalink)

    Hello,

    You shoud give the RadMenuItem the image sized at the size you wish to display it at. For exmaple
    RadMenuItem item = new RadMenuItem();
    item.Image = Properties.Resources.disks; // a 48x48 image
    item.Text = "My Large Item";
    item.AutoSize = true;
    this.radMenuItem1.Items.Add(item);
    Hope that helps
    Richard

    Reply

  • Russell avatar

    Posted on Mar 31, 2011 (permalink)

    Hi Richard,

    Thanks for the informative response. I guess the right way to do this, from the documentation, is to use an ImageList on the menu, right? In the Infragistcs menu system, I can just specify an image and the dimensions - which is nice, because I can use the same image throughout the application, and just scale it. I can use a 256x256 image anywhere in the application, and just scale it down to 24x24 for the menu - if I had to create 65 images in three different sizes, just so I could use them in three different places throughout the application, that would be really painful...

    So, i could just create an ImageList and scale that, right? Then assign that to the RadMenu and provide an index into the ImageList instance for each of the RadMenuItems, yes?

    Thanks,

    Russ

    Reply

  • Posted on Mar 31, 2011 (permalink)

    Hi Russell,

    You can't just resize the ImageList as this recreates the handle. You would have to readd the add the images to the ImageList before resizing the images. See this MSDN article for more information

    Regards,
    Richard

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Apr 5, 2011 (permalink)

    Hello Russel,

    Yes, using ImageList is the way to scale groups of images. ImageList is not a RadControl so more information about it can be found on the MSDN.

    Basically, here are the steps you should follow in order to get this working:
    1. Drag an ImageList from the Toolbox.
    2. Add images to the list by editing its Images collection.
    3. On its Smart Tag or in the property grid: set the ImageSize property to 16,16.
    4. Select your RadMenu control and set its ImageList so that it points to the previously created ImageList.
    5. On each RadMenuItem: change its ImageIndex property to the index of the desired image in the list.

    I hope you find this useful. Feel free to ask if you have any further questions.

    Greetings,
    Ivan Todorov
    the Telerik team

    Reply

  • usman avatar

    Posted on Jun 30, 2011 (permalink)

    i still cant understand , i just simple want the increase in height of the menu , currently its like 30px i want to make it 50px  with distortion of rollover and click 

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Jul 5, 2011 (permalink)

    Hello Usman,

    I am not sure I fully understand your requirements. Which part of the menu you want to increase? Is it the RadMenu control, the drop-down menu or the menu items?

    Basically, setting the MinSize property should do the this, but if you provide me with more details about your requirement, I will be able to provide you with more exact answer.

    Additionally, could you also explain in more detail the desired behavior of the distortion on rollover and click? This will let me provide you with adequate support.

    Looking forward to hearing from you.

    Regards,
    Ivan Todorov
    the Telerik team

    Register for the Q2 2011 What’s New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

    Reply

  • Palanivelu avatar

    Posted on Mar 26, 2012 (permalink)

    how can i set image height and width property???
    am waiting for your response


    Thanking you
    Palanivelu. S

    Reply

  • Ivan Petrov Ivan Petrov admin's avatar

    Posted on Mar 29, 2012 (permalink)

    Hello Palanivelu,

    Thank you for writing.

    Can you please elaborate more on what you want to achieve. My colleague, Ivan Todorov, has given a step by step explanation on how to set the images size in the ImageList in his post from 5-April-2011. If you want to do something different, I would, again, ask you to provide some more details on your goal.

    I am looking forward to you reply.

    Regards,
    Ivan Petrov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Menu, Application Menu, Context Menu > Can you set width/height for RadMenuItem image?!?
Related resources for "Can you set width/height for RadMenuItem image?!?"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]