this->FormBorderStyle = ::FormBorderStyle::None;
// 錯誤:「::」左側必須為類型、「None」非全域命名空間成員
::FormBorderStyle 表示**全域命名空間**下的 FormBorderStyle 類型,但該枚舉實際位於 System::Windows::Forms 命名空間。:: 前無識別碼時代表全域命名空間,**不代表「當前命名空間」**。
// 1. 完整命名空間 (最清晰)
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
// 2. 已 using namespace System::Windows::Forms;
this->FormBorderStyle = FormBorderStyle::None;
// 3. 針對枚舉的 using (C++/CLI 支援)
using enum System::Windows::Forms::FormBorderStyle; // C++20 標準 C++,C++/CLI 需確認支援
this->FormBorderStyle = None;
提問者截圖顯示 IntelliSense 提示 System::Windows::Forms::FormBorderStyle,確認命名空間路徑。
using namespace System; using namespace System::Windows::Forms; using namespace System::Drawing;。:: 除非確確指向全域命名空間 (極少見)。FormBorderStyle::None 增強可讀性。