Export (0) Print
Expand All
Expand Minimize

SystemParameters::VirtualScreenWidth Property

Gets a value that indicates the width, in pixels, of the virtual screen.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public:
static property double VirtualScreenWidth {
	double get ();
}
<object property="{x:Static SystemParameters.VirtualScreenWidth}"/>

Property Value

Type: System::Double
The width of the virtual screen.

The virtual screen is the bounding rectangle of all display monitors. The VirtualScreenTop and VirtualScreenLeft metrics are the coordinates of the upper-left corner of the virtual screen.

Maps to SM_CXVIRTUALSCREEN. See GetSystemMetrics.

This example shows how to access and use the properties of SystemParameters in order to style or customize a button.

System resources expose several system based settings as resources in order to help you create visuals that are consistent with system settings. SystemParameters is a class that contains both system parameter value properties, and resource keys that bind to the values. For example, FullPrimaryScreenHeight is a SystemParameters property value and FullPrimaryScreenHeightKey is the corresponding resource key.

In XAML, you can use the members of SystemParameters as either a static property usage, or a dynamic resource references (with the static property value as the key). Use a dynamic resource reference if you want the system based value to update automatically while the application runs; otherwise, use a static reference. Resource keys have the suffix Key appended to the property name.

The following example shows how to access and use the static values of SystemParameters to style or customize a button. This markup example sizes a button by applying SystemParameters values to a button.

<Button FontSize="8" Margin="10, 10, 5, 5" Grid.Column="0" Grid.Row="5"      
     HorizontalAlignment="Left" 
     Height="{x:Static SystemParameters.CaptionHeight}"
     Width="{x:Static SystemParameters.IconGridWidth}">
     SystemParameters
</Button>

To use the values of SystemParameters in code, you do not have to use either static references or dynamic resource references. Instead, use the values of the SystemParameters class. Although the non-key properties are apparently defined as static properties, the runtime behavior of WPF as hosted by the system will reevaluate the properties in realtime, and will properly account for user-driven changes to system values. The following example shows how to set the width and height of a button by using SystemParameters values.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft