Check menu item

2 posts, 0 answers
  1. Yoni
    Yoni avatar
    10 posts
    Member since:
    Feb 2013

    Posted 09 Sep 2014 Link to this post

    Hello,

    I have a menu item with image
    I wish to check on/off the menu (highlight the image) when the user click on it (same like with the toolbar check button - when the button is checked the image is highlighted)

    I used the tooglestate property but this works only without image

    Thanks

  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 11 Sep 2014 Link to this post

    Hi Yoni,

    Thank you for writing.

    In this case you should use two different images and change them when the toggle state is changed:
    void radMenuItem3_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args)
    {
        if (args.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
        {
            radMenuItem3.Image = Image.FromFile(@"C:\Users\karamfilov\Downloads\close.png");
        }
        else
        {
            radMenuItem3.Image = Image.FromFile(@"C:\Users\karamfilov\Downloads\close1.png");
        }
    }

    I hope this helps. Should you have any other questions do not hesitate to ask.
     
    Regards,
    Dimitar
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top