This documentation is archived and is not being maintained.

IsColor Property

.NET Framework 1.1

Returns true if the device has a color display. The default value is false.

public virtual bool IsColor {
   get
}

Example

The following example demonstrates how to use the IsColor property to select an image.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
Dim currentCapabilities As MobileCapabilities = CType(Request.Browser, MobileCapabilities)
If currentCapabilities.IsColor Then
   ' Set the path of an image to the color image.
   Image1.ImageUrl = "Color.bmp"
Else
   ' Set the path of an image to the monochrome image.
   Image1.ImageUrl = "Monochrome.bmp"
End If

End Sub

[C#]

public void Page_Load(Object sender, EventArgs e)
{
   MobileCapabilities currentCapabilities
      = (MobileCapabilities)Request.Browser;
   if (currentCapabilities.IsColor)
   {
      // Set the path of an image to the color image.
      Image1.ImageUrl="Color.bmp";
   }
   else
   {
      // Set the path of an image to the monochrome image.
      Image1.ImageUrl="Monochrome.bmp";
   }
}

See Also

Applies to: MobileCapabilities Class

Show: