Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to remove white border from calendar control.

Please help me!!

Thanks for advance.

What I have tried:

In style, specified Background and Border Brush Property value as Transparent.
Still white color border is displaying.
Posted
Updated 3-May-22 4:50am
Comments
George Swan 3-May-22 7:58am    
Have you tried BorderThickness=0?

1 solution

What you're seeing is an internal border that's fixed in the control's template at BorderThickness="2,2,2,2" and colour white. You can only change it by changing the control's template.

This works:
C#
InitializeComponent();
Loaded += (s, e) =>
    {
	Border b1 = TreeHelper.FindChild<Border>(TheCalendar);
	Border b2 = TreeHelper.FindChild<Border>(b1);
	b2.BorderBrush = Brushes.Transparent;
    };

It shows a bit of code added into the constructor of the window containing the calendar control. You could change b2.BorderThickness to zero rather than change the colour, if you prefer. Implementation of the TreeHelper class is left as an exercise for the reader.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900