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

background border in context menu

1 Answer 109 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Victor
Top achievements
Rank 1
Victor asked on 14 Jul 2014, 04:22 PM
How do I make the background in the context menu semi-transparent background with opacity of 0.50?


_ContextMenu.Margin = new Thickness(0,200,0,0);
_ContextMenu.BorderBrush = new SolidColorBrush(Colors.Green);
_ContextMenu.BorderThickness = new Thickness(10, 10, 10, 10);
_ContextMenu.IsFadeEnabled = true;
_ContextMenu.Background = new SolidColorBrush(Colors.Transparent);

using this code I get a completely transparent background but I want an opaque background of 50% black.
setting the _ContextMenu.Opacity = 0.50; does not seem to change anything.

Do I need to add a border somehow?

Thanks,
Victor

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 16 Jul 2014, 09:18 AM
Hi Victor,

Thank you for the question.

Instead of setting the Opacity of the ContextMenu, you have to set its Background to a color with alpha component:
_ContextMenu.Background = new SolidColorBrush(new Color { A = 25, R = 0, G = 0, B = 0 });

I hope this helps. Please, let us know if you have further questions.

Regards,
Rosy Topchiyska
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ContextMenu
Asked by
Victor
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or