|
-
February 16th, 1999, 10:40 AM
#1
Drawing in UserControls
I have created a usercontrol with constituent controls in it and I want to draw over the top of these.However since in VB drawing methods always appear on a separate layer behind controls this is not possible. I tried putting a blank transparent usercontrol over the top as a drawing layer, but you can't draw on a transparent control. If anyone has any idea how I could get around this, I would be very grateful. Rupert
-
February 16th, 1999, 10:56 AM
#2
Re: Drawing in UserControls
Hi
This is not easy. Windows sends a message to each control whenever it need's repainting (ie. whenever you've painted on top of one of the controls/moved a form in front of them/whatever).
What exactly are you trying to draw ? There may be an easier solution for you.
Regards
Chris Eastwood
Software Engineer
ACNielsen Ltd
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
February 16th, 1999, 11:03 AM
#3
Re: Drawing in UserControls
Thanks for your response Chris,
What I have is like a DTP layout page type affair with various types of elements in it. I want to allow the user to select these with a standard selection marquee ie. mousedown, drag, mouseup and then any elements within that marquee are selected. To do this I need to draw the marquee while it is being dragged.
Rupert
-
February 16th, 1999, 11:55 AM
#4
Re: Drawing in UserControls
Hi
I can't be of much use I'm afraid. I know of some samples in the VB Knowledge Base (article Q 71488 and Q71489 - look them up at http://msdn.microsoft.com ) which demonstrate how to draw the Rubber-Band selection boxes, but if my memory serves me correctly, it won't draw on-top of the controls.
I may have some code to help you with the moving of the contained items though.
Hope it helps
Regards
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|