Form activation

rbulph

Junior Contributor
Joined
Feb 17, 2003
Messages
397
I'm surprised that, at runtime, if you click on an MDI child form or select one of its controls, it doesn't get activated, i.e. its caption bar remains the same colour and the MDI's caption doesn't get changed. I thought activation of a form in this manner was standard behaviour - if you look at Word for instance you will see that the form does get activated.

So is there a very simple way to achieve this effect? I can use the form's Enter event, but that won't trigger if the user clicks on the form, only on a control that is capable of being entered. So any thoughts?
 
The behavior I see is that each child window does get colored in the "Active Window" titlebar color while the other child windows remain in the "Inactive Window" titlebar color. The MDIParent window itself always shows up as the "Active Window" for the titlebar color.

If you maximize a child window, it's caption (Titlebar's Text) is incorporated into the MDIParent window's title. The text changes from:
Form1
to
Form1 - [Child1]

I can post a test project if you'd like. Or maybe you could post yours?

-nerseus
 
Yes, you're right, usually this works OK. So after a bit of playing around I figured out what is causing it for me - it's my use of the SetScrollInfo API. If I take that out I don't have the problem. Why this should have the described effect I've no idea, but I think I can work around it by activating the form on its MouseDown event etc.
 
Back
Top