private void FormStart_Load(object sender, EventArgs e) { //设置AERO效果 marg = new DwmApi.MARGINS(this.Width, this.Height, this.Width, this.Height); if (Config.IsWindowsVistaOrHigher()) //如果是vista以上 { if (DwmApi.DwmIsCompositionEnabled()) //如果dwm被启用了(有AERO效果) { this.BackColor = Color.Black; this.picIcon.BackColor = Color.Black; DwmApi.DwmExtendFrameIntoClientArea(this.Handle, marg); } } }