控制鼠标的形状

控制鼠标的形状

   我们在做数据库应用的时候,经常会使用到SQL查询,或者一些很费时间的操作,当然其它运算也会出现这种状况,在运算执行的过程中,我们希望能够鼠标形状变为忙状态,这样比较直观。
其实在Delphi里面实现这个效果是非常简单的。只要使用下面一个简单的语句就可以实现。
None.gif Try
None.gif  screen.Cursor :
= crHourGlass;  
None.gif
// 你的运算
None.gif
 
None.gif
finally
None.gif     screen.Cursor :
=  crDefault;
None.gifend;
 
 
代码就是这么简单的一点,关键是我们要知道通过鼠标显示状态对应的值,它是用一个枚举类型的变量存储的,我们可以通过Delphi的帮助系统查找到。
Unit
 
Controls or QControls
 
Delphi syntax:
 
type TCursor = -32768..32767;
 
C++ syntax:
 
enum TCursor {crMin=0x7fff-1, crMax=0x7fff};
 
Description
 
TCursor is an index into the global list of available cursors maintained by the Screen variable. TCursor values can include indexes to custom cursors added by an application, in addition to the predefined constants defined in the controls unit. The following table lists the predefined cursor constants and their position in the Cursors property array:
不同的值对应的不同鼠标如下所示:
  1.jpg
2.jpg
有了这些,我们就可以根据自己的需要改变鼠标形状了。

转载于:https://www.cnblogs.com/BlueMagic/archive/2005/05/21/160177.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值