This blog talks about how to disable close (X) button from Title bar in in C#.
Solution:
Just copy and paste this code snippet In your .cs code .
protected override CreateParams CreateParams
{
get
CreateParams cp = base.CreateParams;
const Int32 CS_NOCLOSE = 0x200;
cp.ClassStyle = CS_NOCLOSE;
return cp;
}