Inserting a User Control in PowerPoint

A

Aaron

Within the .NET framework I've created a class that derives from System.Windows.Forms.UserControl. I override the OnPaint() method to draw a text string on the control surface and implement ComRegisterFunctionAttribute() so that this control can be registered as COM control. I then start PowerPoint 2003 and insert this control onto a slide. When I select "View>Slide Show" I see the control on the slide. If I select the control with the mouse the whole slide starts to refresh (including the navigator buttons in left bottom corner of the presentation) and the CPU usage reaches 100%.

If I override the WndProc() method of this UserControl and block the WM_SETFOCUS (0x07) message, the problem will disappear and everything works fine, however, if I put another control (any control that can receive focus; like a button) onto the UserControl, and select the control duringduring the slide show, the constant refreshing behavior starts again.

I don't want to have to create a customized control for every user control I use and I' concerned about the side effects of blocking the WM_SETFOCUS message. Is there another solution to this issue?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top