RadMenu DropDown color?

4 posts, 0 answers
  1. Sherlock
    Sherlock avatar
    17 posts
    Member since:
    Oct 2013

    Posted 14 Nov 2013 Link to this post

    Hi
    I have four questions:
    1. How can I make transparency drop down menu in RadMenu items?
    2. How can I make transparency drop down menu header ?
    3. how can I change the color of selection of buttons? I mean when mouse moves on buttons, it appears yellow. I need it to be appear green.
    4. How to make disappear the drop down header line? I mean if you pay attention to the drop down menu, you can see a vertical band at the left or right side of the drop down menu, depends on right to left setting. I need this band to be disappear like a very simple drop down.
    Thanks
  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 19 Nov 2013 Link to this post

    Hello Sherlock,

    Thank you for contacting Telerik Support.

    Please have a look at the following code snippet, demonstrating how to achieve the desired style:
    public Form1()
    {
        InitializeComponent();
     
        //#3 change items hover color
        foreach (RadMenuItem item in radMenu1.Items)
        {
            item.MouseEnter += item_MouseEnter;
            item.MouseLeave += item_MouseLeave;
        }
     
        //#1 transparent RadMenu
        radMenu1.MenuElement.MenuFill.BackColor = Color.Transparent;
     
        RadDropDownMenuElement ddl = radMenuItem1.DropDown.PopupElement as RadDropDownMenuElement;
        
        if (ddl != null)
        {
            //#2 transparent drop down menu
            radMenuItem1.DropDown.BackColor = Color.Transparent;
            ddl.Fill.BackColor = Color.Transparent;
     
            //#4 disable drop down header line
            ddl.LeftColumnElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
        }
    }
     
    private void item_MouseLeave(object sender, EventArgs e)
    {
        RadMenuItem item = sender as RadMenuItem;
        item.FillPrimitive.BackColor = Color.Transparent;
    }
     
    private void item_MouseEnter(object sender, EventArgs e)
    {
        RadMenuItem item = sender as RadMenuItem;
        item.FillPrimitive.BackColor = Color.Green;
        item.FillPrimitive.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
        item.BorderPrimitive.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
    }

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sherlock
    Sherlock avatar
    17 posts
    Member since:
    Oct 2013

    Posted 19 Nov 2013 Link to this post

    Great help!
    Solved :)

    But just one question.
    As I see your kindfull example, you changed the selection color via handler.
    Of course it works, but I need to know isn't there anyway to change this color without using handler of mouse hover?
    For example some codes like this:

    this.radMenu1.MenuElement.MenuFill.SelectionColor.BackColor = Color.Red;


    I believe there is no field name which is "SelectionColor"
    But I just curious that if there isn't any options in settings of radMenu? Or any settings in Hiararchy menu?
    Thanks.
  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 22 Nov 2013 Link to this post

    Hello Sherlock,

    Thank you for writing back.

    You are also allowed to customize selection color via modifying the theme in Visual Style BuilderMore details about using the Visual Style Builder can be found here:
    1.     Loading predefined themes
    2.     Working with Repository Items
    3.     Saving and Loading Theme Files
    4.     Loading Themes from an External File
    5.     Loading Themes from a Resource
    6.     Applying Theme to a Control
    7.     
    http://tv.telerik.com/watch/winforms/visualstylebuilder/whats-new-visual-style-builder-q1-2010

    Please do not hesitate to contact us if you have any additional questions.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top