Variables
private: int PositionTopLast;
private: int PositionLeftLast;
In the forms Constructor
PositionTopLast = 0x7fffffff;
PositionLeftLast = 0x7fffffff;
Form Load
//SET FORM TO LAST LOCATION
try
{
if (PositionTopLast != 0x7fffffff)
{
this->Top = PositionTopLast;
this->Left = PositionLeftLast;
}
}
catch (Exception ^)
{
}
Form Position Changed
private: System::Void frmMyForm_ResizeEnd(System::Object^ sender, System::EventArgs^ e)
{
if ((this->Top != PositionTopLast) || (this->Left != PositionLeftLast))
{
PositionTopLast = this->Top;
PositionLeftLast = this->Left;
}
}
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.