junk memo
Layout suspend/resume
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
true 1
false 0
ref class myClass {
} ; // semi-colon
// include guarde
#pragma once
// include guarde
#ifndef __MY_H__
#define __MY_H__
:
:
#endif
Argument をいちいちmainの引数から引き回さなくてもどこでも読める?
array<String^>^args = Environment::GetCommandLineArgs();
Form::AutoScaleBaseSize
- to maintain a consistent look and feel on a different display resolution or system
font
- automatic scaling either according to the default system font or the display resolution.
- Optionally, automatic scaling can be disabled in an application.
- AutoScaleBaseSize property (which is now deprecated) was set to the height and width of the default
system font on the developer's machine.
-
Windows Forms now uses the following logic to automatically scale forms and their
contents:
At design:
- each ContainerControl records the scaling mode and it current resolution in the
AutoScaleMode and AutoScaleDimensions,.
At run :
- the actual resolution is stored in the CurrentAutoScaleDimensions property.
- The AutoScaleFactor property dynamically calculates the ratio between the run-time
and design-time scaling resolution.
- When the form loads, if the values of CurrentAutoScaleDimensions and AutoScaleDimensions
are different, then the PerformAutoScale method is called to scale the control and
its children.
- This method suspends layout and calls the Scale method to perform the actual scaling.
- Afterwards, the value of AutoScaleDimensions is updated to avoid progressive scaling.
PerformAutoScale is also automatically invoked in the following situations:
- In response to the OnFontChanged event if the scaling mode is Font.
- When the layout of the container control resumes and a change is detected in the
AutoScaleDimensions or AutoScaleMode properties.
- As implied above, when a parent ContainerControl is being scaled.
- Each container control is responsible for scaling its children using its own scaling
factors and not the one from its parent container.
Child controls can modify their scaling behavior through several means:
- The ScaleChildren property can be overridden to determine if their child controls
should be scaled or not.
- The GetScaledBounds method can be overridden to adjust the bounds that the control
is scaled to, but not the scaling logic.
- The ScaleControl method can be overridden to change the scaling logic for the current
control.
Layout
The SuspendLayout and ResumeLayout methods are used in tandem to suppress multiple
Layout events while adjusting multiple attributes of the control.
typically
- call the SuspendLayout method
- set the Size, Location,
Anchor, or Dock properties of the control
- call the ResumeLayout method
to enable the changes to take effect.