[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

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

algirdas.k

3/3/2008 10:28:00 AM

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?