From: Charlie on
Hi,

I have a ComboBox on an MDI form. After I load a child form I'm unable to
do frmMDI.cboWhatever.SetFocus

I get no error but the combo does not get the focus. I presume I need to do
something else first. Any ideas?

TIA,
Charlie
From: Larry Serflaten on

"Charlie" <Charlie(a)discussions.microsoft.com> wrote
>
> I have a ComboBox on an MDI form. After I load a child form I'm unable to
> do frmMDI.cboWhatever.SetFocus
>
> I get no error but the combo does not get the focus. I presume I need to do
> something else first. Any ideas?


Set the TabIndex for the controls on that form such that your combo
is the lowest numbered index (eg. 0)

LFS


From: Charlie on
The TabIndex is already zero, but the control is not on a child form. It's
pasted to a Sheridan 3D SSPanel that's pasted to the MDI form. Maybe that's
the problem.

"Larry Serflaten" wrote:

>
> "Charlie" <Charlie(a)discussions.microsoft.com> wrote
> >
> > I have a ComboBox on an MDI form. After I load a child form I'm unable to
> > do frmMDI.cboWhatever.SetFocus
> >
> > I get no error but the combo does not get the focus. I presume I need to do
> > something else first. Any ideas?
>
>
> Set the TabIndex for the controls on that form such that your combo
> is the lowest numbered index (eg. 0)
>
> LFS
>
>
> .
>
From: Larry Serflaten on

"Charlie" <Charlie(a)discussions.microsoft.com> wrote

> The TabIndex is already zero, but the control is not on a child form. It's
> pasted to a Sheridan 3D SSPanel that's pasted to the MDI form. Maybe that's
> the problem.

Just as a test, did you try settting focus in the form's Activate event?

LFS


From: Charlie on
Yes. In the child form activate event I tried several iterations of setting
focus to the MDI combo box, making the MDIForm_Activate sub public and
calling it from within the child form activate event, putting another
cbo.setfocus in the MDIForm_Activate, etc.

Interestingly enough, when I put a debug break in the code and ran it, then
continued from the breakpoint without changing anything it worked. Something
about the IDE window getting the focus for the break, I presume. Without the
break it fails. Compiling and running the .exe fails too. The child form
simply retains the focus. I give.

"Larry Serflaten" wrote:

>
> "Charlie" <Charlie(a)discussions.microsoft.com> wrote
>
> > The TabIndex is already zero, but the control is not on a child form. It's
> > pasted to a Sheridan 3D SSPanel that's pasted to the MDI form. Maybe that's
> > the problem.
>
> Just as a test, did you try settting focus in the form's Activate event?
>
> LFS
>
>
> .
>
 |  Next  |  Last
Pages: 1 2
Prev: SHA1 Hash
Next: The NNTP exodus continues.