This is a migrated thread and some comments may be shown as answers.

RadMenu DropDown color?

3 Answers 152 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Sherlock
Top achievements
Rank 1
Sherlock asked on 14 Nov 2013, 11:15 PM
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

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Nov 2013, 04:12 PM
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 >>
0
Sherlock
Top achievements
Rank 1
answered on 19 Nov 2013, 07:05 PM
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.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Nov 2013, 04:53 PM
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 >>
Tags
Menu
Asked by
Sherlock
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Sherlock
Top achievements
Rank 1
Share this question
or