Re: property exists (OnPaint followup)
Peter Osucha <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
Chris, I probably wasn't clear. The Infragistics controls do, of course, inherit from System.Windows.Forms.Control. I can access the .BackColor just fine. The problem is that the Infragistics people really want you to use there Appearance.BackColor instead of just the BackColor. They want you to use it so much in fact that if I set the Appearance.BackColor to something (eg, transparent), BackColor does not get set to transparent (it seems the developers dropped the ball). I can't set the BackColor of the control, I can only set the Appearance.BackColor. And since they don't update the BackColor for the control when I change the Appearance.BackColor, then I need to be able to retrieve the Appearance.BackColor. I guess I can look for info on a InfragisticsControlBaseClass - the support group doesn't seem that knowledgable though when it comes to this stuff. Peter -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Chris Anderson Sent: Wednesday, May 23, 2007 2:14 PM To: [email protected] Subject: Re: [DOTNET-WINFORMS] property exists (OnPaint followup) > 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