Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I need to crop a child control (a CEdit) in CDialog. I don't want to resize it. Say the bounds of the child control CRect(10, 10, 100, 100) in dialog's client coordinate. Now I want it to crop so that it only paints in CRect(30, 30, 70, 70).

I think I need to use CRgn. But now sure exactly how I would do it.

Thanks in advance.

/Mizan
Posted
Comments
Sergey Alexandrovich Kryukov 14-Aug-13 6:57am    
None of the child controls should be cropped. They are not designed to be.
—SA
Mizan Rahman 16-Aug-13 7:45am    
Hi, It seems I cannot enter code in qestion/answere. So please have a look at this post: http://www.codeproject.com/Articles/2095/A-Guide-to-WIN32-Clipping-Regions?msg=4638230#xx4638230xx
Richard MacCutchan 14-Aug-13 7:19am    
This is not the way to use a dialog. Either fix the size at design time, or use a normal Window.
Mizan Rahman 16-Aug-13 7:39am    
Hi,
It seems I cannot enter code in qestion/answere. So please have a look at this post:
http://www.codeproject.com/Articles/2095/A-Guide-to-WIN32-Clipping-Regions?msg=4638230#xx4638230xx
Richard MacCutchan 16-Aug-13 7:45am    
Well I guess you did not read my comment, or that of Gospodin Kryukov.

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