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

A

algirdas.k

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
direction.

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
used)

Is this a bug in Visual Studio (I'm using 2005) and are there any
solutions?
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top