property exists (OnPaint followup)
Peter Osucha <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
As a follow on to my painting question, I need to obtain the 'BackColor' of the hosting 'canvas' control. For the VS controls, this is simple since there is a BackColor property. For other controls that changed the name of the 'BackColor' property or that have the BackColor property another level deep in their object model, it isn't quite as simple. For example, the infragistics control I want to use as the canvas exposes the BackColor property inside an 'Appearance' property. So for the System.Windows.Forms.Panel object, I get the BackColor from Color myColor = _canvas.BackColor; For the Infragistics.WinGroupBox object, I get the BackColor from... Color myColor = _canvas.Appearance.BackColor; If the 'Appearance' property exists for the object assigned to _canvas, then I will use it. So what I am asking is, how do I check to see if the object '_canvas' has a property called 'Appearance'? Peter