Wrong mouse location in OnClick event at System.Web.UI.Design.ControlDesiger

Discussion in 'ASP .Net Building Controls' started by algirdas.k, Mar 3, 2008.

  1. algirdas.k

    algirdas.k Guest

    I'm writing a custom ASP.NET web control, which renders some graphic
    elements. In design time, I need to be able to select those elements
    and to edit their properties. System.Web.UI.Design.ControlDesigner
    (which we extend) exposes method OnClick(DesignerRegionMouseEventArgs
    e) to handle the click on control at design time, but unfortunately
    e.Location gives correct mouse location on custom control only when
    whole design surface is visible, that is - whole designed page fits,
    there are no scrollbars and designed page is not scrolled in any

    If design surface (designed page) is scrolled, i.e. custom control has
    changed it's position on screen, e.Location gives same results, as if
    no scroll occurred.
    (to overcome such problem in Windows.Forms, PointToClient would be

    Is this a bug in Visual Studio (I'm using 2005) and are there any
    algirdas.k, Mar 3, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.