Kieron Posted April 22, 2003 Posted April 22, 2003 Hi, I'm trying to overrides a buttons OnPaint or OnPaintBackground event. However when the buttons flatstyle is set to system these event aren't called. The point was to be able to draw an image on a button with the visual style set to the current visual style (if any). Does anyone have any ideas how I can get around/ do this... Cheers, Kieron :D Quote
aewarnick Posted April 27, 2003 Posted April 27, 2003 I know that when setting a controls color from the system colors you cannot just use Color= Color.Red It must be Color= SystemColors.Red So, maybe the events have System in them somewhere. . . Quote C#
*Gurus* divil Posted April 28, 2003 *Gurus* Posted April 28, 2003 The point of setting Flatstyle to System is that the system assumes all drawing responsibility for the buttons, so I'm not surprised that you can't override those events and achieve anything. You should try subclassing WndProc and looking for the WM_PAINT message. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.