被光標(biāo)的位置,折騰了大半天.
問(wèn)題,在程序中客戶區(qū)設(shè)置光標(biāo)變?yōu)榉糯?Zoom out)光標(biāo).當(dāng)放大光標(biāo)(Zoom out)從客戶區(qū)接近到Scrollview 的ScrollBar時(shí),應(yīng)該變成普通的Arrow 光標(biāo).但奇怪的是,非但沒(méi)變,反而是越過(guò)Scrollbar ,才變成普通的Arrow 光標(biāo).
查看代碼中的OnSetCursor,SetCurosr 都不是問(wèn)題,MSDN,Goole 一圈也沒(méi)發(fā)現(xiàn),有人遇到此問(wèn)題.
分析下,以為是光標(biāo)大小問(wèn)題,使用VC調(diào)整 Cursor資源,意外發(fā)現(xiàn)hot spot這個(gè)屬性,將放大光標(biāo)(Zoom out)的hot spot從(0,0)調(diào)整到最下面的點(diǎn)(28,28)位置,運(yùn)行程序,正常
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