DpiAwareControl Class
A Control that listens for changes in DPI of per-monitor DPI aware applications to enable DPI awareness in versions of .NET Framework where it is not natively supported.
public class DpiAwareControl : Control, IDisposable, IDpiAwareElement
- Inheritance:
- object MarshalByRefObject Component Control object
- Derived:
- StandardColorPicker NavigableSymbolSelector IntelliPromptParameterInfo IntelliPromptQuickInfo
- Implements:
- IDisposable IDpiAwareElement
Remarks
For internal use only.
Constructors
DpiAwareControl()
Initializes an instance of the class.
public DpiAwareControl()
Properties
DpiScaleFactor
The current DPI-based scale factor to be applied when rendering the element, where Width is applied to the x-axis, and Height is applied to the y-axis.
[Browsable(false)]
public SizeF DpiScaleFactor { get; }
Property Value
See Also
Methods
DpiScaleChanged(SizeF)
Called when the DPI-based scale factor of the element changes.
protected virtual void DpiScaleChanged(SizeF scaleFactor)
| Parameter | Type | Description |
|---|---|---|
| scaleFactor | SizeF | The new scale factor where Width is applied to the x-axis, and Height is applied to the y-axis. |
See Also
OnDpiChangedAfterParent(EventArgs)
Raises the DpiChangedAfterParent event.
protected override void OnDpiChangedAfterParent(EventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | An DpiChangedEventArgs that contains the event data. |
Inherited Members
- MarshalByRefObject.GetLifetimeService()
- MarshalByRefObject.InitializeLifetimeService()
- MarshalByRefObject.MemberwiseClone(bool)
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()
Extension Methods
- DpiAwareElementExtensions.AutoScaleFont(IDpiAwareElement, Font)
- DpiAwareElementExtensions.AutoScaleFontSize(IDpiAwareElement, float)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Padding)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Point)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Rectangle)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Size)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, SizeF)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, int)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, float)
- DpiAwareElementExtensions.ScaleLogicalValue(IDpiAwareElement, Padding)
- DpiAwareElementExtensions.SynchronizeScaleFactorWithChildren(IDpiAwareElement)
- ObjectExtensions.TryConvertToDouble(object, out double)
- ObjectExtensions.TryConvertToDouble(object, IFormatProvider, out double)
- ControlExtensions.FindAncestorOfType<T>(Control, bool)
- ControlExtensions.FindCommonAncestor(Control, Control)
- ControlExtensions.FindDescendantOfType<T>(Control, bool)
- ControlExtensions.GetAncestors(Control)
- ControlExtensions.GetChildren(Control)
- ControlExtensions.GetDescendants(Control)
- ControlExtensions.GetParent(Control)
- ControlExtensions.GetParent<T>(Control)
- ControlExtensions.GetSelfAndAncestors(Control)
- ControlExtensions.GetSelfAndDescendants(Control)
- ControlExtensions.GetSiblings(Control)
- ControlExtensions.IsAncestorOf(Control, ILogicalTreeNode)
- ControlExtensions.IsAncestorOf(Control, Control)