Home All Groups Group Topic Archive Search About

MDI form title bar doesn't focus

Author
6 Jun 2006 4:58 AM
nik
My MDI form does not regain focus when I click on the title bar. Once
my MDI form loses focus I can click on it to bring it back into focus,
except on the title bar. The icon and the minimize, maximize, close
buttons will all bring it into focus, so it is really just the middle
of the title bar that won't restore focus to the MDI form.

Thanks

Author
6 Jun 2006 1:04 PM
Jeff Johnson
"nik" <nikb***@gmail.com> wrote in message
news:1149569884.813577.221230@g10g2000cwb.googlegroups.com...

> My MDI form does not regain focus when I click on the title bar. Once
> my MDI form loses focus I can click on it to bring it back into focus,
> except on the title bar. The icon and the minimize, maximize, close
> buttons will all bring it into focus, so it is really just the middle
> of the title bar that won't restore focus to the MDI form.

I have nothing to say except "That's really screwed up."
Author
6 Jun 2006 2:46 PM
nik
Yeah its really weird. I am hoping that there is just some stupid
setting that I haven't done right, but having some of it respond and
not the whole title bar is strange.


Jeff Johnson wrote:
Show quoteHide quote
> "nik" <nikb***@gmail.com> wrote in message
> news:1149569884.813577.221230@g10g2000cwb.googlegroups.com...
>
> > My MDI form does not regain focus when I click on the title bar. Once
> > my MDI form loses focus I can click on it to bring it back into focus,
> > except on the title bar. The icon and the minimize, maximize, close
> > buttons will all bring it into focus, so it is really just the middle
> > of the title bar that won't restore focus to the MDI form.
>
> I have nothing to say except "That's really screwed up."
Author
6 Jun 2006 3:13 PM
Jeff Johnson
"nik" <nikb***@gmail.com> wrote in message
news:1149605183.520004.71420@i39g2000cwa.googlegroups.com...

> Yeah its really weird. I am hoping that there is just some stupid
> setting that I haven't done right, but having some of it respond and
> not the whole title bar is strange.

I seriously doubt there's any "setting" involved. Something's messed up on
your machine.
Author
6 Jun 2006 3:45 PM
Jan Hyde
"Jeff Johnson" <i.get@enough.spam>'s wild thoughts were
released on Tue, 6 Jun 2006 11:13:13 -0400 bearing the
following fruit:

>"nik" <nikb***@gmail.com> wrote in message
>news:1149605183.520004.71420@i39g2000cwa.googlegroups.com...
>
>> Yeah its really weird. I am hoping that there is just some stupid
>> setting that I haven't done right, but having some of it respond and
>> not the whole title bar is strange.
>
>I seriously doubt there's any "setting" involved. Something's messed up on
>your machine.
>

Unless he's using some APIs or some such. I know of one app
where the MDI gained and lost focus as you tabbed though the
controls on the child form as a side effect of some 'fancy'
API work (not my work I hasten to add)







Jan Hyde (VB MVP)

--
Hot Pants: Breeches of promise  (M. Rose Pierce)
Author
6 Jun 2006 5:27 PM
Karl E. Peterson
nik wrote:
> My MDI form does not regain focus when I click on the title bar. Once
> my MDI form loses focus I can click on it to bring it back into focus,
> except on the title bar. The icon and the minimize, maximize, close
> buttons will all bring it into focus, so it is really just the middle
> of the title bar that won't restore focus to the MDI form.

You're not hooking WM_NCPAINT or something weird like that, are you?
WM_APPACTIVATE, perhaps?
--
Working without a .NET?
http://classicvb.org/
Author
6 Jun 2006 7:41 PM
nik
No nothing like that.

But I should add that I can also double click on the title bar when it
is out of focus and it will maximize and come into focus, but a single
click still won't bring into focus.

Could it have anything to do with how I load the child forms.
I just have:
Load Child_Form1

without any Show command, which I read was OK, but maybe...

Thanks

Karl E. Peterson wrote:
Show quoteHide quote
> nik wrote:
> > My MDI form does not regain focus when I click on the title bar. Once
> > my MDI form loses focus I can click on it to bring it back into focus,
> > except on the title bar. The icon and the minimize, maximize, close
> > buttons will all bring it into focus, so it is really just the middle
> > of the title bar that won't restore focus to the MDI form.
>
> You're not hooking WM_NCPAINT or something weird like that, are you?
> WM_APPACTIVATE, perhaps?
> --
> Working without a .NET?
> http://classicvb.org/
Author
6 Jun 2006 9:35 PM
Karl E. Peterson
nik wrote:
> No nothing like that.
>
> But I should add that I can also double click on the title bar when it
> is out of focus and it will maximize and come into focus, but a single
> click still won't bring into focus.
>
> Could it have anything to do with how I load the child forms.
> I just have:
>  Load Child_Form1
>
> without any Show command, which I read was OK, but maybe...

Unlikely that'd have any sort of negative effect.

I'd suggest making a copy of the project, in a new folder, and just start
stripping stuff out until the problem goes away.  That should provide some
clue what's up.  This one's really odd.
--
Working without a .NET?
http://classicvb.org/
Author
7 Jun 2006 10:02 PM
RonW
On 5 Jun 2006 21:58:04 -0700, "nik" <nikb***@gmail.com> wrote:

>My MDI form does not regain focus when I click on the title bar. Once
>my MDI form loses focus I can click on it to bring it back into focus,
>except on the title bar. The icon and the minimize, maximize, close
>buttons will all bring it into focus, so it is really just the middle
>of the title bar that won't restore focus to the MDI form.
>
>Thanks

Are you *sure* the form doesn't have focus? Not suggesting you're an idiot but
just wondering if the form only *looks* like it doesn't have focus.

Reason: I have seen the main title bar for Excel 2K appear with Windows' (XP)
inactive color scheme even though a child form (spreadsheet file) was active and
Excel was obviously the currently active app on the system. Don't know why it
happens but minimizing and restoring seems to sort it out. Sometimes just
clicking around (like on the Minimize/Restore/Close buttons) works too.

Just grasping at a straw I've seen in one of MS's own apps.
Forgive me if I made it sound like I think you don't know what you're doing. Not
my intent.

RW
Author
8 Jun 2006 7:22 PM
Jeff Johnson
<RonW@no_domain.invalid> wrote in message
Show quoteHide quote
news:ojie82le8le13pj1h1htsoeimi8ta8ht0t@4ax.com...
> On 5 Jun 2006 21:58:04 -0700, "nik" <nikb***@gmail.com> wrote:

> Are you *sure* the form doesn't have focus? Not suggesting you're an idiot
> but
> just wondering if the form only *looks* like it doesn't have focus.
>
> Reason: I have seen the main title bar for Excel 2K appear with Windows'
> (XP)
> inactive color scheme even though a child form (spreadsheet file) was
> active and
> Excel was obviously the currently active app on the system. Don't know why
> it
> happens but minimizing and restoring seems to sort it out. Sometimes just
> clicking around (like on the Minimize/Restore/Close buttons) works too.

Actually I've seen the VB IDE do that a lot. Usually clicking the button on
the taskbar helps.
Author
14 Jun 2006 6:33 PM
nik
Thanks for the idea... maybe it will help.

I might be getting focus, just not getting moved to the foreground. If
I place a different window over my application, say a browser, then
click on the center of my apps title bar nothing appears to happen to
my application window. But the other application loses focus. It's
title bar fades.

I tried to place a MDIForm_GetFocus( ) subroutine into the MDI form,
but I don't think that I am doing it right. I can get an Activate event
once, but how do I get a focus event if not

Private Sub MDIForm_GetFocus( )

Also, given that the title bar does seem to have some effect, just
doesn't bring my application to the forefront is there anything to do?
Author
14 Jun 2006 6:55 PM
Bob O`Bob
nik wrote:
Show quoteHide quote
> Thanks for the idea... maybe it will help.
>
> I might be getting focus, just not getting moved to the foreground. If
> I place a different window over my application, say a browser, then
> click on the center of my apps title bar nothing appears to happen to
> my application window. But the other application loses focus. It's
> title bar fades.
>
> I tried to place a MDIForm_GetFocus( ) subroutine into the MDI form,
> but I don't think that I am doing it right. I can get an Activate event
> once, but how do I get a focus event if not
>
> Private Sub MDIForm_GetFocus( )
>
> Also, given that the title bar does seem to have some effect, just
> doesn't bring my application to the forefront is there anything to do?
>


1) The event name is GotFocus
2) MDI forms don't have it