Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
3.00/5 (3 votes)
See more:
Hi Friends,

I have an interesting question for all.
How can i restrict a dialog box(Modal or modeless) to stay within the
application boundaries?

It should behave just like a CView child object which do not
go out of application boundaries.

I know we can do it with OnMove(..) event handling.
But, i wanted to know whether there are any other direct means
like by setting some properties to CDialog class.

Please help me with this. :)

Regards,
K ARUN KUMAR
Posted
Updated 3-May-10 20:30pm
v2
Comments
Richard MacCutchan 4-May-10 4:51am    
Please do not post the same question in different forums. I have already answered this in the C++ forum.

You may find this DavidCrow's article [^] helpful.
:)
 
Share this answer
 
Got the solution with OnMoving(..) event handling..
Here is the link

http://www.codeproject.com/Messages/3461670/Re-How-To-Restrict-Dialog-Box-in-an-SDI-to-be-With.aspx
 
Share this answer
 
v2
restrict MessageBox to calling form Boundry by
1. set cursor location relative to msgBox
2.on form mouse_move compare location of cursor to calling form boundries and stop changing location after boundries :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900