xref:System.Windows.Controls.Control.Background%2A
(xref:System.Windows.Media.Brush?displayProperty=nameWithType) |
xref:System.Windows.Forms.Control.BackColor%2A
(xref:System.Drawing.Color?displayProperty=nameWithType) |
The xref:System.Windows.Forms.Integration.WindowsFormsHost element sets the xref:System.Windows.Forms.Control.BackColor%2A property of the hosted control and the xref:System.Windows.Forms.Control.BackgroundImage%2A property of the hosted control. Mapping is performed by using the following rules:
- If xref:System.Windows.Controls.Control.Background%2A is a solid color, it is converted and used to set the xref:System.Windows.Forms.Control.BackColor%2A property of the hosted control. The xref:System.Windows.Forms.Control.BackColor%2A property is not set on the hosted control, because the hosted control can inherit the value of the xref:System.Windows.Forms.Control.BackColor%2A property. Note: The hosted control does not support transparency. Any color assigned to xref:System.Windows.Forms.Control.BackColor%2A must be fully opaque, with an alpha value of 0xFF.
- If xref:System.Windows.Controls.Control.Background%2A is not a solid color, the xref:System.Windows.Forms.Integration.WindowsFormsHost control creates a bitmap from the xref:System.Windows.Controls.Control.Background%2A property. The xref:System.Windows.Forms.Integration.WindowsFormsHost control assigns this bitmap to the xref:System.Windows.Forms.Control.BackgroundImage%2A property of the hosted control. This provides an effect which is similar to transparency. Note: You can override this behavior or you can remove the xref:System.Windows.Controls.Control.Background%2A property mapping. |
| xref:System.Windows.FrameworkElement.Cursor%2A |
xref:System.Windows.Forms.Control.Cursor%2A |
If the default mapping has not been reassigned, xref:System.Windows.Forms.Integration.WindowsFormsHost control traverses its ancestor hierarchy until it finds an ancestor with its xref:System.Windows.FrameworkElement.Cursor%2A property set. This value is translated to the closest corresponding Windows Forms cursor.
If the default mapping for the xref:System.Windows.FrameworkElement.ForceCursor%2A property has not been reassigned, the traversal stops on the first ancestor with xref:System.Windows.FrameworkElement.ForceCursor%2A set to true. |
xref:System.Windows.FrameworkElement.FlowDirection%2A
(xref:System.Windows.FlowDirection?displayProperty=nameWithType) |
xref:System.Windows.Forms.Control.RightToLeft%2A
(xref:System.Windows.Forms.RightToLeft?displayProperty=nameWithType) |
xref:System.Windows.FlowDirection.LeftToRight maps to xref:System.Windows.Forms.RightToLeft.No.
xref:System.Windows.FlowDirection.RightToLeft maps to xref:System.Windows.Forms.RightToLeft.Yes.
xref:System.Windows.Forms.RightToLeft.Inherit is not mapped.
xref:System.Windows.FlowDirection.RightToLeft?displayProperty=nameWithType maps to xref:System.Windows.Forms.RightToLeft.Yes?displayProperty=nameWithType. |
| xref:System.Windows.Controls.Control.FontStyle%2A |
xref:System.Drawing.Font.Style%2A on the hosted control's xref:System.Drawing.Font?displayProperty=nameWithType |
The set of [!INCLUDETLA2#tla_winclient] properties is translated into a corresponding xref:System.Drawing.Font. When one of these properties changes, a new xref:System.Drawing.Font is created. For xref:System.Windows.FontStyles.Normal%2A: xref:System.Drawing.FontStyle.Italic is disabled. For xref:System.Windows.FontStyles.Italic%2A or xref:System.Windows.FontStyles.Oblique%2A: xref:System.Drawing.FontStyle.Italic is enabled. |
| xref:System.Windows.Controls.Control.FontWeight%2A |
xref:System.Drawing.Font.Style%2A on the hosted control's xref:System.Drawing.Font?displayProperty=nameWithType |
The set of [!INCLUDETLA2#tla_winclient] properties is translated into a corresponding xref:System.Drawing.Font. When one of these properties changes, a new xref:System.Drawing.Font is created. For xref:System.Windows.FontWeights.Black%2A, xref:System.Windows.FontWeights.Bold%2A, xref:System.Windows.FontWeights.DemiBold%2A, xref:System.Windows.FontWeights.ExtraBold%2A, xref:System.Windows.FontWeights.Heavy%2A, xref:System.Windows.FontWeights.Medium%2A, xref:System.Windows.FontWeights.SemiBold%2A, or xref:System.Windows.FontWeights.UltraBold%2A: xref:System.Drawing.FontStyle.Bold is enabled. For xref:System.Windows.FontWeights.ExtraLight%2A, xref:System.Windows.FontWeights.Light%2A, xref:System.Windows.FontWeights.Normal%2A, xref:System.Windows.FontWeights.Regular%2A, xref:System.Windows.FontWeights.Thin%2A, or xref:System.Windows.FontWeights.UltraLight%2A: xref:System.Drawing.FontStyle.Bold is disabled. |
xref:System.Windows.Controls.Control.FontFamily%2A
xref:System.Windows.Controls.Control.FontSize%2A
xref:System.Windows.Controls.Control.FontStretch%2A
xref:System.Windows.Controls.Control.FontStyle%2A
xref:System.Windows.Controls.Control.FontWeight%2A |
xref:System.Windows.Forms.Control.Font%2A
(xref:System.Drawing.Font?displayProperty=nameWithType) |
The set of [!INCLUDETLA2#tla_winclient] properties is translated into a corresponding xref:System.Drawing.Font. When one of these properties changes, a new xref:System.Drawing.Font is created. The hosted Windows Forms control resizes based on the font size.
Font size in [!INCLUDETLA2#tla_winclient] is expressed as one ninety-sixth of an inch, and in Windows Forms as one seventy-second of an inch. The corresponding conversion is:
Windows Forms font size = [!INCLUDETLA2#tla_winclient] font size * 72.0 / 96.0. |
xref:System.Windows.Controls.Control.Foreground%2A
(xref:System.Windows.Media.Brush?displayProperty=nameWithType) |
xref:System.Windows.Forms.Control.ForeColor%2A
(xref:System.Drawing.Color?displayProperty=nameWithType) |
The xref:System.Windows.Controls.Control.Foreground%2A property mapping is performed by using the following rules:
- If xref:System.Windows.Controls.Control.Foreground%2A is a xref:System.Windows.Media.SolidColorBrush, use xref:System.Windows.Media.SolidColorBrush.Color%2A for xref:System.Windows.Forms.Control.ForeColor%2A. - If xref:System.Windows.Controls.Control.Foreground%2A is a xref:System.Windows.Media.GradientBrush, use the color of the xref:System.Windows.Media.GradientStop with the lowest offset value for xref:System.Windows.Forms.Control.ForeColor%2A. - For any other xref:System.Windows.Media.Brush type, leave xref:System.Windows.Forms.Control.ForeColor%2A unchanged. This means the default is used. |
| xref:System.Windows.UIElement.IsEnabled%2A |
xref:System.Windows.Forms.Control.Enabled%2A |
When xref:System.Windows.UIElement.IsEnabled%2A is set, xref:System.Windows.Forms.Integration.WindowsFormsHost element sets the xref:System.Windows.Forms.Control.Enabled%2A property on the hosted control. |
| xref:System.Windows.Controls.Control.Padding%2A |
xref:System.Windows.Forms.Control.Padding%2A |
All four values of the xref:System.Windows.Forms.Control.Padding%2A property on the hosted Windows Forms control are set to the same xref:System.Windows.Thickness value.
- Values greater than xref:System.Int32.MaxValue are set to xref:System.Int32.MaxValue. - Values less than xref:System.Int32.MinValue are set to xref:System.Int32.MinValue. |
| xref:System.Windows.UIElement.Visibility%2A |
xref:System.Windows.Forms.Control.Visible%2A |
- xref:System.Windows.Visibility.Visible maps to xref:System.Windows.Forms.Control.Visible%2A = true. The hosted Windows Forms control is visible. Explicitly setting the xref:System.Windows.Forms.Control.Visible%2A property on the hosted control to false is not recommended. - xref:System.Windows.Visibility.Collapsed maps to xref:System.Windows.Forms.Control.Visible%2A = true or false. The hosted Windows Forms control is not drawn, and its area is collapsed. - xref:System.Windows.Visibility.Hidden : The hosted Windows Forms control occupies space in the layout, but is not visible. In this case, the xref:System.Windows.Forms.Control.Visible%2A property is set to true. Explicitly setting the xref:System.Windows.Forms.Control.Visible%2A property on the hosted control to false is not recommended. |