Override the custom control's CreateParams property as shown in this sample.
protected override CreateParams CreateParams
{
get
{
CreateParams cparams = base.CreateParams;
cparams.ExStyle &= ~512;
cparams.Style &= ~8388608; // WS_BORDER
cparams.ExStyle |= 512; // WS_EX_DLGFRAME
return cparams;
}
}
Contributed from George Shepherd's Windows Forms FAQ