// center form in code inside constructor public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); this->CenterToScreen(); }