Windows form shadow

6 posts, 0 answers
  1. Luca
    Luca avatar
    6 posts
    Member since:
    Dec 2011

    Posted 05 Aug 2015 Link to this post

    Hello

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

    Thanks.

  2. Dimitar
    Admin
    Dimitar avatar
    1414 posts

    Posted 06 Aug 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Luca
    Luca avatar
    6 posts
    Member since:
    Dec 2011

    Posted 06 Aug 2015 in reply to Dimitar Link to this post

    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

  5. Dimitar
    Admin
    Dimitar avatar
    1414 posts

    Posted 07 Aug 2015 Link to this post

    Hello Luca,

    Thank you for writing back.

    A very good example for this is available here: wenerme/winform.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
  6. Luca
    Luca avatar
    6 posts
    Member since:
    Dec 2011

    Posted 13 Aug 2015 Link to this post

    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

  7. Dimitar
    Admin
    Dimitar avatar
    1414 posts

    Posted 14 Aug 2015 Link to this post

    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready