Using VB6 I have written a custom ctl using the combolistbox as an intrinsic control. When used in an SDI application it works as expected. When used in an MDI application everything works except for one thing. If the control has the focus and a MsgBox is displayed the focus does not seem to go back to the custom control. I think it is because the MDI child form has lost focus. Does anyone know of a solution? I have attempted to capture the parent form within the control itself by setting it to a form variable that has withevents to capture the form's lost focus event and then execute the form variable's setfocus method, but the lostfocus event does not seem to fire. Any ideas on a different solution or a different event to trap? The points will be distributed across all contributors with the lion's share (200) going to the accepted answer.
I have attached the ctl code with a test project (just remove the. txt extensions). I hope someone can help.
Here is some additional information: To cause the problem just click in the text portion of the combobox and press the enter key. Next close the dialogue window and notice that the blinking caret does not appear in the combobox indicating that the combobox has focus. Now if you pause the running of the vb environment and then continue it the caret appears in the combobox.