TShape的控件,设置了Cursor为crHandPoint。当Shape是圆时,鼠标移到设计时的方形上,鼠标就已经变成手,我想做一个鼠标移到圆上光标才变成手的控件。该怎么做?
各位,请帮帮忙。

解决方案 »

  1.   

    动态设定不可以吗?
    在TShape的OnMouseMove事件中加上Shape1.Cursor := crHandPoint;
    这样是不是你想要的?
      

  2.   


    unit Unit1;interfaceuses
      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.
      

  3.   

    楼上说的是用Panel.Panel有Handle,但是TShape是没有Handle的,因此用不成.
    而且用SetWindowRgn将Panel设置为一个象素的正弦波时,显示会出见断断续续的问题.