From: Larry Serflaten on

"Charlie" <Charlie(a)discussions.microsoft.com> wrote
> Compiling and running the .exe fails too. The child form
> simply retains the focus. I give.

If there are controls on the form, one of them should be
given the focus, not the form itself. In that child form's
Activate event, find out which control that is:

MsgBox ActiveControl.Name

That may help to figure out why it gets the focus,
and what you can do about it....

(Always test the exe, the IDE (as you saw) can mess
with the process)

LFS


From: Charlie on
The problem is not in the child form's control. When the child form is
loaded the control with tab index=0 gets the focus no problem. What I'm
trying to do is set the focus to a control on the MDI form.

The MDI form has a Sheridan 3D SSPanel pasted below the menu bar. In it are
standard controls such as text boxes, combo boxes, etc. When a child form is
loaded the SSPanel remains in view, below the menu bar and above the top edge
of the child form. The purpose is to have common controls that can be used
regardless of which child form is loaded at the time, rather than having to
duplicate the controls on each child form.

When a child form is loaded it's default control (TabIndex=0) gets the
focus. What I'm trying to do is move the focus back to a control on the MDI
form, in the SSPanel. It ain't working. I think I'll just live with it. :(

P.S. I inherited the program. I'm going to dis-inherit it. Or is it
dis-herit?

"Larry Serflaten" wrote:

>
> "Charlie" <Charlie(a)discussions.microsoft.com> wrote
> > Compiling and running the .exe fails too. The child form
> > simply retains the focus. I give.
>
> If there are controls on the form, one of them should be
> given the focus, not the form itself. In that child form's
> Activate event, find out which control that is:
>
> MsgBox ActiveControl.Name
>
> That may help to figure out why it gets the focus,
> and what you can do about it....
>
> (Always test the exe, the IDE (as you saw) can mess
> with the process)
>
> LFS
>
>
> .
>
From: Dee Earley on
On 10/05/2010 17:24, Charlie wrote:
> 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?

Does frmMDI.SetFocus beforehand help?
Trying it here, it works regardless, but using a standard picturebox as
a container.

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
First  |  Prev  | 
Pages: 1 2
Prev: SHA1 Hash
Next: The NNTP exodus continues.