Autoscale

Can you autoscale in windows application form with GUI, if so how?
Do you mean using a sizer ?
I believe he means auto sizing controls (ie buttons, text areas)...

A nice Win32 example here:

http://www.codeproject.com/Articles/141908/Resizing-Win32-Dialogs-with-DialogBox-and-Dialog-R
Last edited on
I think the link you gave me will help. I'm trying to auto size a graph using chart control with windows application form in visual studio.
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.
Ah, I am sorry, are you using MFC?

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:

http://www.codeproject.com/Articles/9434/Automatic-resizing-controls?msg=4110163


If you are using CLR, or .NET (which it looks like you are), I really can't help you much, sorry!
But MS has some .NET Autosize info here (I really don't use .NET though):
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.autosize.aspx
Last edited on
Yes, I am using .NET. Thanks for your help anyways!
Topic archived. No new replies allowed.