Make Oneself More Strong

mcs51a( 高兴就写点:-),不高兴就不写 )

VC cursor的位置(hot spot)

   问题,在程序中客户区设置光标变为放大(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

  1. On the Image Editor toolbar, click the Set Hotspot tool.

  2. Click the pixel you want to designate as the cursor's hot spot.

    The Hotspot property in the Properties window displays the new coordinates.


    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.



posted on 2010-08-11 09:22 mcs51a 阅读(960) 评论(0)  编辑 收藏 引用

【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理