I was able to find a solution in VB code here: showthread. Here is a test coed example you can refer to. The result: Here is a related thread you can refer to. Best Regards, Daniel Zhang. Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. The solution you provided works if the panel is directly on the form. Unfortunate it will not work with the panel over a Tabcontrol.
Hello JoSRM For a movable control any control see the following Code Project article. I didn't address the actual panel as it's DevExpress third party library which I don't have but should work fine.
This sets the line at the top. It's just there as it requires atleast one of them to be non 0. If I remove the Padding and Top Line etc. And in the CreateParams overide, if I remove the aero enabled check, it shows a dropshadow similar like this:. This is the Form class named "Borderless", in a spark of creativity. I tried to make it look like what you already have posted, to minimize the "impact". These are all the declarations needed, plus others that might become useful.
It's a partial class because the Winapi class is a extensive class library. You can change it to whatever you are used to. I set the bottomHeight to 3, and I found that the border height was included in the form size the form's size didn't change.
So I set a BackgroundImage to this form, and the border was hidden by the image. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Borderless Form Dropshadow Ask Question. Asked 3 years, 9 months ago. Active 6 months ago. Location; pt. DrawLine pen, pt. X, pt. Y, pt. Width - 1, pt. Mike Mike 3 3 silver badges 11 11 bronze badges.
I did test it and it did work and I did change it DrawLine pen, p. Hi, nice tweak - I only applied the bottom shadow as I was emulating Material Design cards in particular but I think that the combination should satisfy anyone looking for a solution. The top answer does in fact generate a shadow, but I personally wasn't satisfied with it for a few reasons: It only works for rectangles granted, WinForms controls are all rectangles, but we might want to use this in other cases More importantly: It's not smooth.
It doesn't look as natural as other shadows in other programs look. Finally, it's slightly annoying to configure. Add panel1 ; this. Width, this. Height, PixelFormat. AddRectangle new Rectangle control. X, control. Y, control. Width, control. Clear Color. Transparent ; g. Round; g. Tim Toady is the founder of Browserling Inc, a cross-browser testing service. This site contains C information, code, tips and news. Software Development Topics. Jun The solution is easy. CreateParams; cp.
0コメント