I'm trying to make my rich text box resize with the window as it is resized. So, if you make the window bigger, the text box will become bigger as well, so that it is always filling the window. Here is my code, but when I resize the window nothing happens. I have setup my event handlers properly.
void Form1_ResizeBegin(Object^ sender, EventArgs^ e)
{
this->formHeightBefore = this->Size.Height;
this->formWidthBefore = this->Size.Width;
this->contentBoxWidthBefore = this->Size.Width;
this->contentBoxHeightBefore = this->Size.Height;
}
void Form1_ResizeEnd(Object^ sender, EventArgs^ e)
{
this->ContentBox->Size = *new Drawing::Size(this->contentBoxHeightBefore+(this->Size.Height-this->formHeightBefore), this->contentBoxWidthBefore+(this->Size.Width-this->formWidthBefore));
}
Any help would be greatly appreciated.
Regards,
Moshe