| View previous topic :: View next topic |
| Author |
Message |
Segal Guest
|
Posted: Fri May 20, 2005 4:02 pm Post subject: Prevent MDI Child from going outside visible area of parent? |
|
|
I've been looking every where for a solution (docs (cpp, vcl, win32
sdk), google (groups, www)) but can't seem to find anything useful.
I want to prevent my MDI chidden from being able to move outside the
visible portion. In other words cage them inside the viewable area. I've
seen some apps do this, and even have a snapping/magnet effect when one
of the child's edges are very close to one of the inner edges of the
parent.
How is this done?
Thank you very much.
|
|
| Back to top |
|
 |
Kent Guest
|
Posted: Sat May 21, 2005 4:16 am Post subject: Re: Prevent MDI Child from going outside visible area of par |
|
|
One way is to handle the WM_MOVING message for the child form and
compare the child form's BoundsRect to the parent form's ClientRect.
Kent
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Sat May 21, 2005 6:22 pm Post subject: Re: Prevent MDI Child from going outside visible area of par |
|
|
Segal wrote:
| Quote: | I want to prevent my MDI chidden from being able to move outside the
visible portion. In other words cage them inside the viewable area. I've
seen some apps do this, and even have a snapping/magnet effect when one
of the child's edges are very close to one of the inner edges of the
parent.
|
Intercept the WM_MOVE message (maybe its called WM_MOVING or so).
Examples how to prevent a window to move or to restrict its position
have been posted before.
Google: Advanced Groups Search
http://www.google.com/advanced_group_search?hl=en
for groups: *cppbuilder* and words
WM_MOVE (and so)
Hans.
|
|
| Back to top |
|
 |
Segal Guest
|
Posted: Sat May 21, 2005 7:04 pm Post subject: Re: Prevent MDI Child from going outside visible area of par |
|
|
Hans Galema wrote:
| Quote: | Segal wrote:
I want to prevent my MDI chidden from being able to move outside the
visible portion. In other words cage them inside the viewable area.
I've seen some apps do this, and even have a snapping/magnet effect
when one of the child's edges are very close to one of the inner
edges of the parent.
Intercept the WM_MOVE message (maybe its called WM_MOVING or so).
Examples how to prevent a window to move or to restrict its position
have been posted before.
Google: Advanced Groups Search
http://www.google.com/advanced_group_search?hl=en
for groups: *cppbuilder* and words
WM_MOVE (and so)
Hans.
|
Thank you very much.
|
|
| Back to top |
|
 |
Segal Guest
|
Posted: Mon May 23, 2005 12:05 am Post subject: Re: Prevent MDI Child from going outside visible area of par |
|
|
Hans Galema wrote:
| Quote: | Segal wrote:
I want to prevent my MDI chidden from being able to move outside the
visible portion. In other words cage them inside the viewable area.
I've seen some apps do this, and even have a snapping/magnet effect
when one of the child's edges are very close to one of the inner
edges of the parent.
Intercept the WM_MOVE message (maybe its called WM_MOVING or so).
Examples how to prevent a window to move or to restrict its position
have been posted before.
Google: Advanced Groups Search
http://www.google.com/advanced_group_search?hl=en
for groups: *cppbuilder* and words
WM_MOVE (and so)
|
Thank you I was able to get it to work, much appreciated :)
|
|
| Back to top |
|
 |
|