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

Shadows of RadForm

7 Answers 366 Views
Form
This is a migrated thread and some comments may be shown as answers.
TRANSEPT
Top achievements
Rank 1
TRANSEPT asked on 28 Jun 2017, 08:07 AM

Hi,

Is it possible to add shadows to my radforms ?

Thanks for your response

7 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 28 Jun 2017, 08:30 AM
Hi,

The following discussion contains the solution for this: Windows form shadow - Forms, Dialogs, TitleBar, StatusStrip - UI for WinForms Forum.

I hope this will be useful. 

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
TRANSEPT
Top achievements
Rank 1
answered on 28 Jun 2017, 08:45 AM

I override the CreateParams property:

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

}

But The shadow is not visible, I don't know why ??

0
Dimitar
Telerik team
answered on 28 Jun 2017, 09:07 AM
Hi,

Do any other windows have shadows? This is controlled in the Windows settings as well - see attached image.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mark
Top achievements
Rank 1
answered on 11 Sep 2019, 10:32 PM

I know this post is slightly dated, but this still seems to be an issue.

After converting my vb.net project to Telerik (all windows.Forms convert to RadForms) now none show a shadow when active.  Visually this is a mess, as some of the forms blend into each other when opened as dialog.  I still have a few windows.ui message boxes that open throughout the application, and these all show the shadow.  

I am attempting to find a property in the Visual Style builder to set this, as I don't want to have to add special code to every form in my application to see this.  

Please let me know if I can configure a component (i'm guessing RadForm) in Visual Style Builder, and what properties if so, to always show a shadow whenever a form is used from my custom package.

As an aside, the Visual Style Builder application and Windows Demo Application both appear to be built on Telerik controls, and neither have a shadow in windows 10 (yes, i'm configured to show shadows, and all other non-Telerik windows show one)

0
Dimitar
Telerik team
answered on 12 Sep 2019, 11:37 AM

Hi Mark,

The shadow effect is not available on our forms. Our theming functionality requires this effect to be disabled (this allow us to customize the borders and the title bar). A possible solution is to disable the form theming, this way you will have a standard title bar and shadows:

public RadForm1()
{
    InitializeComponent();

    this.AllowTheming = false;

}

I hope this helps. Should you have any other questions, do not hesitate to ask.

Regards,


Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Mark
Top achievements
Rank 1
answered on 12 Sep 2019, 02:40 PM

Thanks for the response.  I would like to use my form theme, so turning it off is not a real option.  I will resign to placing a code block in each child form of the application to set it off from the parent form.  The code block below is what I am using, and was translated from an earlier post on this thread to VB.net.  It seems to work, but only produces a shadow to the right and bottom of the form.  How can I adjust this to get a shadow on all 4 borders?

 

    Protected Overrides ReadOnly Property CreateParams As CreateParams
        Get
            Const CS_DROPSHADOW As Integer = &H20000
            Dim cp As CreateParams = MyBase.CreateParams
            cp.ClassStyle = cp.ClassStyle Or CS_DROPSHADOW
            Return cp
        End Get
    End Property

 

Thanks again for your assistance.

0
Dimitar
Telerik team
answered on 13 Sep 2019, 08:10 AM

Hi Mark,

The DropShadow style is the only predefined shadow style that can be used in this case. And the aero style cannot be enabled for a single form with code. You can see more information about this in the following threads: 

 

A good solution (complex, however) is available here as well: wenerme/winform.DropShadow: A winform DropShadow demo.

I hope this helps. 

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Form
Asked by
TRANSEPT
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
TRANSEPT
Top achievements
Rank 1
Mark
Top achievements
Rank 1
Share this question
or