CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    30

    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

  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    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



  3. #3
    Join Date
    Apr 1999
    Posts
    30

    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

  4. #4
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    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
  •  





Click Here to Expand Forum to Full Width

Featured