Share via


ScreenCharactersWidth Property

Returns the approximate width of the display, in characters. The default value is 12.

public virtual int ScreenCharactersWidth {
   get
}

Remarks

This value can be derived from the assumed character size and actual screen pixel size. The algorithm for determining the height uses a combination of the default sizes (from the .config file), device-specific sizes (again, in the .config file) and explicit headers sent by the devices. These values are not necessarily exact (that is, for width, especially for variable-width fonts, these values are approximate). Some devices might rely on internal default values.

The following algorithm is used to calculate the height

if this["screenCharactersWidth"] is not null, 
   then return this["screenCharactersWidth"]; 
else, if this["screenPixelsWidth'] is not null and this["characterWidth"] is not null, 
      then return this["screenPixelsWidth']/ this["characterWidth"]; 
else, if this["screenPixelsWidth'] is not null, 
   then return this["screenPixelsWidth']/this["defaultCharacterWidth"]; 
else, if this["characterWidth"] is not null, 
   then return this["defaultScreenPixelsWidth"]/this["characterWidth"]; 
else, return this["defaultScreenCharactersWidth"].

Note   You cannot rely on the following statement.

   this.ScreenCharactersWidth == this["screenCharactersWidth"]

See Also

Applies to: MobileCapabilities Class