UserControl problems with DrawEdge and SelectClipRgn API - clipping custom frame control 
Author Message
 UserControl problems with DrawEdge and SelectClipRgn API - clipping custom frame control

Quote:
> I've been trying to make my own frame UserControl but I've been running
into
> one problem.  Currently I am using the DrawEdge API function to create a
> variety of borders for my custom frame control and it has worked out
great.
> I have also added some scroll bars that allow me to scroll any controls a
> user drops into the frame and this is where I run into trouble.

> Whenever one of the controls that are placed in my UserControl frame are
> scrolled up and out of the UserControl, they appear to go over the top of
> the border that I created with the DrawEdge function.  The lack of proper
> clipping ruins the effect of the 3D border that my frame uses.  I tried
> using the CreateRectRgn API to set up a rectangle within the DrawEdge
border
> and apply those coordinates to the SelectClipRgn API to try and clip
> anything that crosses the border without success.  I do not know whether I
> am using the wrong functions or whether I am just using them incorrectly.

> Can anyone provide a suggestion on how to create a clipping effect for
> controls that crosses my DrawEdge border?  Any help or suggestions would
be
> greatly appreciated!

You need to nest a control inside your UserControl, I'd recommend a picture
box as it can easily contain other controls.  Just make this internal
control borderless and slightly smaller than the parent UserControl frame by
1 to 3 pixels per side (Depending on the border style)
Hope this helps,

    Mike

 -- EDais --

WWW: http://www.*-*-*.com/




Sat, 07 Feb 2004 07:29:31 GMT  
 UserControl problems with DrawEdge and SelectClipRgn API - clipping custom frame control
Alex:

This post appears across at least 4 newsgroups.  In the future, please
multi-post so we can see all replies together and avoid duplicating responses.

Rob

Quote:

> I've been trying to make my own frame UserControl but I've been running into
> one problem.  Currently I am using the DrawEdge API function to create a
> variety of borders for my custom frame control and it has worked out great.
> I have also added some scroll bars that allow me to scroll any controls a
> user drops into the frame and this is where I run into trouble.

> Whenever one of the controls that are placed in my UserControl frame are
> scrolled up and out of the UserControl, they appear to go over the top of
> the border that I created with the DrawEdge function.  The lack of proper
> clipping ruins the effect of the 3D border that my frame uses.  I tried
> using the CreateRectRgn API to set up a rectangle within the DrawEdge border
> and apply those coordinates to the SelectClipRgn API to try and clip
> anything that crosses the border without success.  I do not know whether I
> am using the wrong functions or whether I am just using them incorrectly.

> Can anyone provide a suggestion on how to create a clipping effect for
> controls that crosses my DrawEdge border?  Any help or suggestions would be
> greatly appreciated!

> Thanks,

> Alex



Sat, 07 Feb 2004 13:52:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. UserControl problems with DrawEdge and SelectClipRgn API - clipping custom frame control

2. DrawEdge API in VB.NET

3. DrawEdge API (Need Help)

4. API created usercontrol tab order problem (Again)

5. API created usercontrol tab order problem

6. Problems while encapsulating DateTimePicker common control API into an Usercontrol (VB5)

7. Problems while Encapsulating DateTimePicker Common Control API in UserControl

8. Problems While Encapsulating the DateTimePicker Common Control API on an UserControl

9. Memory problems with DrawEdge

10. DrawEdge Problem

11. Win32 API Problem: Can't show custom icon with MessageBoxIndirect

12. Parent UserControl's Properties in a UserControl (placed on another UserControl)

 

 
Powered by phpBB® Forum Software