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

Windows form shadow

7 Answers 2616 Views
Form
This is a migrated thread and some comments may be shown as answers.
Luca
Top achievements
Rank 1
Luca asked on 05 Aug 2015, 04:22 PM

Hello

How can i set a shadow on my windows form? When i create a telerik form, default shadow disappear.

Thanks.

7 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 06 Aug 2015, 09:39 AM
Hello Luca,

Thank you for contacting us.

Our from is actually inheriting the default .NET one but it sets its border style to none. This why the shadow is not visible. To show the shadow you should override the CreateParams property:
protected override CreateParams CreateParams
{
    get
    {
        const int CS_DROPSHADOW = 0x20000;
        CreateParams cp = base.CreateParams;
        cp.ClassStyle |= CS_DROPSHADOW;
        return cp;
    }
         
}

More information about this is available in the following discussions:
Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Luca
Top achievements
Rank 1
answered on 06 Aug 2015, 09:45 PM

Thank you very much for answer. 

Sorry if I'm boring, but what do I have to do for a shadow like this?

Thanks.

Regards,

Luca

0
Dimitar
Telerik team
answered on 07 Aug 2015, 01:17 PM
Hello Luca,

Thank you for writing back.

A very good example for this is available here: /.DropShadow

Do not hesitate to contact us if you have other questions.
 
Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Luca
Top achievements
Rank 1
answered on 13 Aug 2015, 02:39 PM

Hello Dimitar.

Thank you very much for answer.

I translated the C# code in Basic code and adapted it to my form. However, when I minimize the window or when I click on the program icon in the taskbar there are some annoying effects. In particular, shadow is drawn before the form. How can I fix it?

I enclose a photo of my form and a video (Youtube - windows form).

Regards,

Luca

0
Dimitar
Telerik team
answered on 14 Aug 2015, 01:35 PM
Hello Luca,

Thank you for writing back.

This is controlled by the operating system and RadForm does not have any properties for this. I would suggest you to search or ask your question in the appropriate forums. Meanwhile, here is what a quick search returned: pinvoke - VB.NET disable fade-in for forms - Stack Overflow

I hope this will be useful.

Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Marc
Top achievements
Rank 1
Veteran
answered on 03 Jun 2020, 08:35 AM

Hello,

is there any solution for Progress OpenEdge?

 

Regards

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Jun 2020, 06:42 AM
Hello, Marc, 

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. 

The easiest way to achieve the shadow is to override the CreateParams method: 
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        public RadForm1()
        {
            InitializeComponent();
        }

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

I understand that you are using OpenEdge and Developer Studio, please note that for OpenEdge related topics the preferred places to submit a technical question are Salesforce and the Progress Community. Thus, the appropriate community and support engineers would gladly assist you to adopt the suggested solutions to ABL. You can log in to these websites straight from your Progress account: https://progresslink.progress.com/supportlink .

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Form
Asked by
Luca
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Luca
Top achievements
Rank 1
Marc
Top achievements
Rank 1
Veteran
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or