遇到不同 FormBorderStyle 模式的问题。在“无”模式下,一切正常。
但是,一旦我将模式更改为其他任何模式-就会发生这种情况:
我周围到处都是奇怪的空白区域。就像两个轴上的界限都关闭了
void InitializeComponent(void)
{
this->SuspendLayout();
//
// MainUI
//
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::None;
this->ClientSize = System::Drawing::Size(320, 250);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedToolWindow;
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = L"MainUI";
this->Text = L"Dota 2 Efficiency Application";
this->ResumeLayout(false);
}
[STAThreadAttribute]
int Main(array<System::String ^> ^args){
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Creating a new form
MainUI^ form = gcnew MainUI();
// Creating a new ListView and adding it to the form
createList();
form->globalTimerInit();
form->Controls->Add(myGlobals::Globals::globalListView);
form->Controls->Add(myGlobals::Globals::labelForTimer);
Application::Run(form);
return 0;
}
当我试图获取 Form 的 Bounds 和 ClientRectangle 时,它会吐出:
{X=0,Y=0,宽度=336,高度=284}
{X=0,Y=0,宽度=320,高度=250}
看起来它是正确的,但该区域是很远的。
有什么建议吗?