Back to Devexpress

XtraForm.IconOptions Property

windowsforms-devexpress-dot-xtraeditors-dot-xtraform-7fb4853c.md

latest3.9 KB
Original Source

XtraForm.IconOptions Property

Provides access to image settings that allow you to assign raster and vector images to XtraForms (instead of traditional .ico images).

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
[DXCategory("Appearance")]
public FormIconOptions IconOptions { get; }
vb
<DXCategory("Appearance")>
Public ReadOnly Property IconOptions As FormIconOptions

Property Value

TypeDescription
DevExpress.XtraEditors.FormIconOptions

Provides access to form icon-related settings.

|

Remarks

Use this property to set up vector or raster image for this form instance.

csharp
this.IconOptions.SvgImage = Properties.Resources.barcodeImage;
vb
Me.IconOptions.SvgImage = My.Resources.barcodeImage

Note that images assigned through the IconOptions object (IconOptions.Image, IconOptions.SvgImage, IconOptions.ImageURI) have priority over the standard Icon property.

A forms icon size is fixed, you cannot use the IconOptions.SvgImageSize property to change this size.

If you need to set up the same image for all DevExpress forms in your application, use the static FormIconOptions.Default property.

csharp
using DevExpress.XtraEditors;

FormIconOptions.Default.SvgImage = Properties.Resources.avocado;
vb
Imports DevExpress.XtraEditors

FormIconOptions.Default.SvgImage = My.Resources.avocado

Note

Use the IconOptions.Image and IconOptions.LargeImage properties to assign raster images with different resolutions to the XtraForm (to avoid blurring). The Image property specifies the image displayed in the title bar. The LargeImage property specifies the image displayed in the taskbar.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the IconOptions property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-memo-editor-advanced-mode/CS/MemoEditSample/Views/SettingsView.cs#L15

csharp
service.FormStyle = (form) => {
    ((XtraForm)form).IconOptions.Assign(this.IconOptions);
    form.FormBorderStyle = FormBorderStyle.FixedToolWindow;

winforms-memo-editor-advanced-mode/VB/MemoEditSample/Views/SettingsView.vb#L18

vb
service.FormStyle = Sub(form)
    CType(form, XtraForm).IconOptions.Assign(Me.IconOptions)
    form.FormBorderStyle = FormBorderStyle.FixedToolWindow

See Also

XtraForm Class

XtraForm Members

DevExpress.XtraEditors Namespace