C++ winforms application Ask


I follow this:
https://stackoverflow.com/a/21266502/5884674
guide to create C++ winforms application. I try to do it fresh with nice flat design (not with 3th party staffs). In my original C# winforms application I have this piece of code which add a shadow to the main window:

1
2
3
4
5
6
7
8
9
10
        protected override CreateParams CreateParams
        {
            get
            {
                const int CS_DROPSHADOW = 0x20000;
                CreateParams cp = base.CreateParams;
                cp.ClassStyle |= CS_DROPSHADOW;
                return cp;
            }
        }

Can someone help me, to make this piece of code work in my C++ winforms project.
Last edited on
Try this:
1
2
3
4
5
6
7
8
9
10
11
12
protected: 
property System::Windows::Forms::CreateParams ^CreateParams
{
  virtual System::Windows::Forms::CreateParams ^get() override
 {
    const int CS_DROPSHADOW = 0x20000;
    System::Windows::Forms::CreateParams^ p = Form::CreateParams;
    p->ClassStyle |= CS_DROPSHADOW;

   return p;
 }
}

Works on VS 2015
Topic archived. No new replies allowed.