Drawing a zoom rectangle?

Posted on 2006-04-16
Last Modified: 2008-02-20
I have an application that looks like:

I want to draw a zoom rectangle by holding down the left mouse button and moving the mouse.
On each mousemove event I'll need to delete the old rectangle.  How can do this without having invalidating the underlying graph?

I tried adding a new drawing surface that is transparent, put I still get paint messages to the main drawing surface (currently a panel)

Question by:rubear
    LVL 85

    Accepted Solution

    See my example here:

    The same approach can be applied to a PictureBox or Panel.

    Expert Comment

    excellent solution!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now