Click to See Complete Forum and Search --> : Drawing in UserControls
Rupert Bates
February 16th, 1999, 09:40 AM
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
Chris Eastwood
February 16th, 1999, 09:56 AM
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
Rupert Bates
February 16th, 1999, 10:03 AM
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
Chris Eastwood
February 16th, 1999, 10:55 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.