想写一个TShape的控件,当Shape是圆时,鼠标移到圆上光标才变成手。大家帮帮忙。该如何处理
想写一个TShape的控件,当Shape是圆时,鼠标移到圆上光标才变成手。大家帮帮忙。
TShape的控件,设置了Cursor为crHandPoint。当Shape是圆时,鼠标移到设计时的方形上,鼠标就已经变成手,我想做一个鼠标移到圆上光标才变成手的控件。该怎么做?
各位,请帮帮忙。
------解决方案--------------------
动态设定不可以吗?
在TShape的OnMouseMove事件中加上
TShape的控件,设置了Cursor为crHandPoint。当Shape是圆时,鼠标移到设计时的方形上,鼠标就已经变成手,我想做一个鼠标移到圆上光标才变成手的控件。该怎么做?
各位,请帮帮忙。
------解决方案--------------------
动态设定不可以吗?
在TShape的OnMouseMove事件中加上
- Delphi(Pascal) code
Shape1.Cursor := crHandPoint;
------解决方案--------------------
- Delphi(Pascal) code
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Panel1: TPanel; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin Panel1.Color := clRed; Panel1.Cursor := crHandPoint; Panel1.SetBounds(50, 80, 100, 100); Panel1.BevelOuter := bvNone; end; procedure TForm1.Button1Click(Sender: TObject); var region: THandle; begin region := CreateEllipticRgn(0, 0, 100, 100); SetWindowRgn(Panel1.Handle, region, True); end; end.
------解决方案--------------------
那就结贴吧。。。。。。。哈哈