In This Article

DpiAwareForm Class

A Form 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 DpiAwareForm : Form, IDisposable, IDpiAwareElement
Inheritance:
object MarshalByRefObject Component Control ScrollableControl ContainerControl Form object
Derived:
NoActivateForm WizardDialogForm
Implements:
IDisposable IDpiAwareElement

Remarks

For internal use only.

Constructors

DpiAwareForm()

Initializes a new instance of DpiAwareForm.

public DpiAwareForm()

Properties

DpiScaleFactor

Gets 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

SizeF:

A SizeF where Width is applied to the x-axis, and Height is applied to the y-axis.

See Also

IsDpiAwareFormShowBehaviorEnabled

Gets if DpiAwareFormShowBehavior should be enabled for this form.

protected virtual bool IsDpiAwareFormShowBehaviorEnabled { get; }

Property Value

bool:

true if DpiAwareFormShowBehavior is automatically applied to the form; otherwise, false. The default value is false.

Remarks

For internal use only.

IsLoaded

Gets if the form has been loaded.

protected bool IsLoaded { get; }

Property Value

bool

Methods

DpiScaleChanged(SizeF)

Called when the DPI-based scale factor of the element changes.

public 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

OnCreateControl()

Raises the CreateControl event.

protected override void OnCreateControl()

OnLoad(EventArgs)

Raises the Load event.

protected override void OnLoad(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

WndProc(ref Message)

Processes Windows messages.

protected override void WndProc(ref Message m)
Parameter Type Description
m Message

The Windows Message to process.

Inherited Members

Extension Methods