winforms - How can I detect when Control.PreferredSize changes? -
I'm using to determine what should be for the form. Whenever there is a change in the control's favorite sissy property, it will be necessary to determine, but does not seem to be a control. PreferredSizeChanged Event. Is there a way to find out when this property can change (potentially using it)? If the property can be avoided then I would like to avoid the elections.
You can override online or onpaint.
private size m_CurrentPreferedSize; Safe Override Zero Online (Layout Avenger ARG E) {base.OnLayout (e); Size newSize = preferred size; If (m_CurrentPreferedSize! = NewSize) {m_CurrentPreferedSize = newSize; // your code here}}
The favorite call is calculated on each call.
Comments
Post a Comment