Drop shadow for floating window

1 Answer 153 Views
Dock
Kumaran
Top achievements
Rank 1
Iron
Kumaran asked on 20 Dec 2021, 06:00 PM

Hi,

I want to enable drop shadow for the floating windows in RadDock. I tried the below code but it didn't work.

window.RootElement.EnableElementShadow = true;
window.RootElement.ShadowColor = Color.GreenYellow;
window.RootElement.ShadowDepth = 10;

Is there a way to enable it?

Thanks

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Dec 2021, 09:25 AM
 Hello, Kumaran,


The floating window is actually a derivative of RadForm. Since RadForm is a derivative of the standard MS Form, making a shadow is more like a general programming questions. That is why it is recommended to follow some of the already referred approaches in this thread:
https://www.telerik.com/forums/windows-form-shadow

RadDock offers the FloatingWindowCreated event which allows you to replace the window with your custom implementation:

        public RadForm1()
        {
            InitializeComponent();
             
            this.radDock1.FloatingWindowCreated += radDock1_FloatingWindowCreated;
        }
        
        private void radDock1_FloatingWindowCreated(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e)
        {
            MyFloatingWindow w = new MyFloatingWindow(this.radDock1); 
            e.Window = w; 
        }

        public partial class MyFloatingWindow : FloatingWindow
        { 
            public MyFloatingWindow(RadDock radDock) : base(radDock)
            {
            }

            protected override CreateParams CreateParams
            {
                get
                {
                    const int CS_DROPSHADOW = 0x20000;
                    CreateParams cp = base.CreateParams;
                    cp.ClassStyle |= CS_DROPSHADOW;
                    return cp;
                }
            }
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Dock
Asked by
Kumaran
Top achievements
Rank 1
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or