Re: property exists (OnPaint followup)
Chris Anderson <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
> I'm annoyed (in many ways) that the Infragistics controls aren't more > clearly thought out on things like this. I mean, almost all of their > controls have an 'Appearance' object that is useful (it groups many > 'neat' look features together for the control). However, the > properties > that the Appearance object holds that are essentially 'pass-throughs' > for the underlying control properties (like BackColor, ForeColor, font, > etc.) should still exist. What do the Infragistics controls inherit from? They are *supposed* to inherit from System.Windows.Forms.Control (which has the BackColor property - which is why all controls have it) How are you defining _canvas? I'm guessing it's not as a Control otherwise _canvas.BackColor would compile fine. If all the Infragistics controls inherit from the same base class (and this base class exposes Appearance), then you could check whether the _canvas object references a InfragisticControlBaseClass (or whatever it is) or System.Windows.Forms.Control (rather than test for all the separate Infragistics control types) > > I understand the thought behind what you are suggesting - however, a > slight twist. As I mentioned, there are plenty of Infragistics > controls > that could be used as a canvas for what I'm doing (just as there are > several VS controls). Every Infragistics control that could be used as > a canvas will have an Appearance property. It would be much cleaner to > try to discover not whether the canvas control can be cast to the many > Infragistics controls but instead to discover whether the canvas > control > had an 'Appearance' property. > > Any good way to do this? > > Peter