Hi!

I have made a button user control which has the following problem. When it is placed on a form, it works without any problems, however when I put it in a frame and set focus to it (either programmatically or by using keyboard or mouse), it hangs. The problem is in its UserControl_EnterFocus and Usercontrol_ExitFocus events, which have code for redrawing control in either selected or deselected state. I put debug statements in both event handlers and it looks like the frame causes the control to constantly change focus from control back to the form, etc. Thus pRedraw procedure constantly fires and there's an endless loop. The control has no code that shifts the focus to the parent programmatically. What can it be? I've read about the 'focus issues' in VB a long time ago, but I don't know where and what the problem exactly was.

Can you help? I will appreciate any tips on this strange issue.

Thanks a lot in advance,
Best regards,
Stanislav