被光标的位置,折腾了大半天.
问题,在程序中客户区设置光标变为放大(Zoom out)光标.当放大光标(Zoom out)从客户区接近到Scrollview 的ScrollBar时,应该变成普通的Arrow 光标.但奇怪的是,非但没变,反而是越过Scrollbar ,才变成普通的Arrow 光标.
查看代码中的OnSetCursor,SetCurosr 都不是问题,MSDN,Goole 一圈也没发现,有人遇到此问题.
分析下,以为是光标大小问题,使用VC调整 Cursor资源,意外发现hot spot这个属性,将放大光标(Zoom out)的hot spot从(0,0)调整到最下面的点(28,28)位置,运行程序,正常
MSDN 上的介绍,
Setting a
Cursor's Hot Spot
The hot
spot of a cursor
is the point to which Windows refers in tracking the cursor's position.
By default, the hot spot is set to the upper-left corner of the cursor
(coordinates 0,0). The Hotspot property in the Properties
window shows the hot spot coordinates.
To set a cursor's hot spot
-
On the Image
Editor toolbar, click the Set Hotspot tool.
-
Click
the pixel you want to designate as the cursor's hot spot.
The Hotspot
property in the Properties window displays the new coordinates.
Tip
|
Tool tips appear when you hover your cursor over a
toolbar button. These tips can help you identify the function of each
button.
|
For information
on adding resources to managed projects, please see Resources
in Applications in the .NET Framework Developer's Guide. For
information on manually adding resource files to managed projects,
accessing resources, displaying static resources, and assigning
resources strings to properties, see Walkthrough:
Localizing Windows Forms and Walkthrough:
Using Resources for Localization with ASP.NET.
Requirements
None