Skip to main content
A newer version of this page is available. .

WindowsFormsSettings.TouchUIMode Property

Gets or sets whether touch UI mode is enabled, in which controls automatically increase their size and the distance between some of their elements. This is a static property.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.Utils.v19.1.dll

Declaration

[DefaultValue(TouchUIMode.Default)]
public static TouchUIMode TouchUIMode { get; set; }

Property Value

Type Default Description
TouchUIMode **Default**

A value that specifies if touch UI mode is enabled.

Available values:

Name Description
Default

The same as False.

True

Touch UI mode is enabled.

False

Touch UI mode is disabled.

Remarks

In touch UI mode, controls automatically increase their size and the distance between some of their elements. The size and distance are increased according to the WindowsFormsSettings.TouchScaleFactor value.

The following images shows a Ribbon Control painted when touch UI mode is disabled and enabled, respectively.

LookAndFeel-TouchUI-False

LookAndFeel-TouchUI-True

To see touch UI mode in action at design time (not at runtime), set the TouchUI setting (and optionally, the TouchScaleFactor setting) in your project’s App.config file, as shown below. Then reopen the project for the changes to apply. Note that the TouchUI and TouchScaleFactor settings from the App.config file are not in effect at runtime. You still need to use the WindowsFormsSettings.TouchUIMode and WindowsFormsSettings.TouchScaleFactor properties to enable touch UI at runtime.


<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral">
      <section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral" requirePermission="false"/>
    </sectionGroup>
  </configSections>
  <applicationSettings>
    <DevExpress.LookAndFeel.Design.AppSettings>
      <setting name="TouchUI" serializeAs="String">
        <value>True</value>
      </setting>
      <setting name="TouchScaleFactor" serializeAs="String">
        <value>1.5</value>
      </setting>
    </DevExpress.LookAndFeel.Design.AppSettings>
  </applicationSettings>

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
</configuration>

The XtraForm and TabForm classes and their descendants (except for the RibbonForm) provide their own ContainerUserLookAndFeel.TouchUIMode and ContainerUserLookAndFeel.TouchScaleFactor properties (accessible from the XtraForm.LookAndFeel object). These properties override the WindowsFormsSettings.TouchUIMode and WindowsFormsSettings.TouchScaleFactor global settings.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TouchUIMode 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.

See Also