What the link said did not work.
This is the structure I have right now:
private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
if(checkBox1->CheckState == CheckState::Checked)
{
this->chart3->AutoSize;
}
The graph didn't do anything when I ran it.
In Win32, the only way to change the size of a control is to manually update it.
IE in the WM_SIZE event. Here is a Win32 Example (for Windows I prefer Win32):
1 2 3 4 5 6 7 8 9 10 11
case WM_SIZE: // Sorry, it removed the tabs ):
{
HWND hwndControl;
RECT rcClient;
GetClientRect(hwnd, &rcClient);
hwndControl = GetDlgItem(hwnd, CONTROL_ID_HERE);
SetWindowPos(hwndControl, NULL, 25, 25, // Scale and center
rcClient.right-50, rcClient.bottom-50, SWP_NOZORDER);
}
In MFC (which I don't use) there is information here: