tags:

views:

133

answers:

3

I'd like my software to display a tutorial window when it first starts up and to have this window appear 'locked' to the right hand side of the main window such that, whenever I move the main window, the child will follow. How can I accomplish this?

+1  A: 

Generally, you will need to trap the OnMove event for the parent window and relocate the child window.

I do not believe that there is a WinAPI way to do this, so it will be a bit of manual coding.

John Gietzen
+2  A: 

As John Gietzen says, there's no way to get Windows to do this for you, and if you do it by handling OnMove events you'll get a lag when the user moves or resizes the main window.

An alternative is to widen the main window and put the tutorial window within it, down the right hand side.

RichieHindle
+4  A: 

As mentioned by John Gietzen, you'll need to trap the movement of your main window and reposition the child window.

However, this will break down if the user moves the child window directly.

If you want to enforce that the two stay together always, you'd be much better trying to put these into a single window. Having two windows and trying to override the normal Windows behavior is probably not a clean approach - it will be more confusing than just trying to make a single "normal" window.

Reed Copsey