Encountered an issue with different FormBorderStyle modes. In 'None' mode everything works fine.
But as soon as I change the mode to anything else - this happens:
I'm getting strange empty area all around. Like the bounds are off on both axis
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;
}
When I'm trying to get Bounds and ClientRectangle of the Form it spits out this:
{X=0,Y=0,Width=336,Height=284}
{X=0,Y=0,Width=320,Height=250}
Looks like it's correct, but the area is way off.
Any advice?


I had multiple instances of __super::WndProc(m); and it resulted in this behavior.
ui.h
stdafx.h