Delphi
1 procedure TForm1.FormCreate(Sender: TObject); 2 begin 3 EnableMenuItem(GetSystemMenu(Handle, FALSE), SC_CLOSE,MF_BYCOMMAND or MF_GRAYED); 4 end;
C#
1 public Frm()2 {3 InitializeComponent();4 this.ControlBox = false;5 6 }