被光標的位置,折騰了大半天.
問題,在程序中客戶區設置光標變為放大(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