Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a circular border around a UI element?

How do I go about creating a circular Border that can hold other UI elements?

Something like this:

A red circle with a drop shadow surrounding a box of text.

Is there some easy way of achieving a similar effect?

like image 997
NVM Avatar asked Mar 03 '11 09:03

NVM


People also ask

How do you draw a circle in WPF?

Use its Stroke property to specify the Brush that is used to paint the outline of the ellipse. The StrokeThickness property specifies the thickness of the ellipse outline. To draw a circle, make the Width and Height of the Ellipse element equal to each other.


1 Answers

easy way to do that;

<Border x:Name="circularBorder" 
   CornerRadius="{Binding Path=ActualHeight, ElementName=circularBorder}" 
   Width="{Binding Path=ActualHeight, ElementName=circularBorder}">
</Border>

Now you have a circular border in all type of screens

like image 155
Hamido Avatar answered Sep 18 '22 18:09

Hamido