AdvancedErrorProviderIconSizeMode Property

Gets or sets the icon sizing behavior for explicitly set icons.
Default value: AutoScale.

Definition

Namespace: KGySoft.WinForms.Components
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
[DefaultValueAttribute(IconSizeMode.AutoScale)]
public IconSizeMode IconSizeMode { get; set; }

Property Value

IconSizeMode

Remarks

If the value of this property is SystemDefault, the behavior is framework dependent. Older frameworks may simply pick the smallest image from the assigned icon, which still may be too large if the icon contains only a large image. Starting with .NET 8.0 the ErrorProvider provider class supports multi-resolution icons, though only the existing resolutions are used, similarly to the GetNearestSize mode.

If the property is set to AutoScale or GetNearestSize, the reference size on 100% DPI is 16 x 16 pixels.

To make auto-scaling work for per-monitor DPI awareness, the ContainerControl property must not be . The Windows Forms designer sets the ContainerControl automatically if you add the AdvancedErrorProvider to the form or user control from the Toolbox.

To autoscale the default icon as well, just get and set it explicitly: myErrorProvider.Icon = myErrorProvider.Icon;

  Tip

It is recommended to use multi-resolution icons in a DPI aware application. You can use the predefined icons from the Icons class.

See Also