AmbientProperties

AmbientProperties

System. Windows .Forms (system. windows .forms.dll) sealed class

The Site is the object that hosts a Control . Control objects can inherit certain properties from their Site , and these are called ambient properties. At present, the ambient properties are ForeColor , BackColor , Cursor , and Font . If you haven't specified a particular value for any of these properties, the control will retrieve an AmbientProperties object from the site by using the GetService() method. The service required is typeof(AmbientProperties) . The control can pull the ambient value from it. If the control is not hosted in a site, or if the site doesn't support ambient properties, the Control.DefaultXXX member will be used to provide the value instead.

 public sealed class  AmbientProperties  {  // Public Constructors  public  AmbientProperties  ();  // Public Instance Properties  public Color  BackColor  {set; get; }    public Cursor  Cursor  {set; get; }    public Font  Font  {set; get; }    public Color  ForeColor  {set; get; } } 


. Net Windows Forms in a Nutshell
.NET Windows Forms in a Nutshell
ISBN: 0596003382
EAN: 2147483647
Year: 2002
Pages: 794

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net