我现在是做一个播放器我想实现, 如果视屏全屏的时候,在3秒内鼠标的左,右以及位置没有发生事件时则隐藏光标,
否则就是可视UP有分

解决方案 »

  1.   

    if 全屏 then
    begin
      Sleep(3000);
      ShowCursor(...);
    end;
      

  2.   

    if 全屏 then
    begin
      Sleep(3000);
      ShowCursor(...);
    end;
    这样的我试过了不行的
    我要的是象WINDOWS的MEDIAPLAYER一样如果鼠标不动或者不左右键。则showcursor(false);否则就是TRUE
      

  3.   

    用Timer控件做怎么样?写form的MouseMove事件。如果鼠标移动,则showcursor(true)并且阻止timer执行ontimer事件。否则激活timer,让timer执行ontimer事件,时间间隔设置成3秒,事件里面写showcursor(false)。
       现在我实现起来还有点问题,不过觉得这个思路应该可行吧?有没高手补充下?
      

  4.   

    不行了这些我都做过了这样程序好象出BUG一样不会动过一会才有反应
      

  5.   

    aqtata(aqtata)
     你说的是意思是用TTIMER控件了,能不能把代码贴出来看看
      

  6.   

    aus(天兵)怎么用,我不会啊。
      

  7.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ExtCtrls, StdCtrls;type
      TForm1 = class(TForm)
        Memo1: TMemo;
        Timer1: TTimer;
        procedure FormCreate(Sender: TObject);
        procedure Timer1Timer(Sender: TObject);
        procedure FormDblClick(Sender: TObject);
        procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
        procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
          Y: Integer);
      private
        { Private declarations }
        x:int64;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    begin
      x:=StrToInt(FormatDateTime('hh24nnss',now));
    end;procedure TForm1.Timer1Timer(Sender: TObject);
    var
      temp:int64;
      diff:int64;
    begin
      temp:=StrToInt(FormatDateTime('hh24nnss',now));
      diff:=temp-x;
      if diff>3 then
        showcursor(false);
    end;procedure TForm1.FormDblClick(Sender: TObject);
    begin
    showcursor(true);
    x:=StrToInt(FormatDateTime('hh24nnss',now));
    end;procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
    showcursor(true);
    x:=StrToInt(FormatDateTime('hh24nnss',now));
    end;procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
    showcursor(true);
    x:=StrToInt(FormatDateTime('hh24nnss',now));
    end;end.
      

  8.   

    procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
    showcursor(true);
    x:=StrToInt(FormatDateTime('hh24nnss',now));
    end;procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
    showcursor(true);
    x:=StrToInt(FormatDateTime('hh24nnss',now));
    end;
    我不知道这两个过程中的,"x"是用在哪里
    而且我试了一下不行。 这个代码
      

  9.   

    你要在程序裡加一個計時器,然後計時器的事件為(上面的代碼中有):procedure TForm1.Timer1Timer(Sender: TObject);
    var
      temp:int64;
      diff:int64;
    begin
      temp:=StrToInt(FormatDateTime('hh24nnss',now));
      diff:=temp-x;
      if diff>3 then
        showcursor(false);
    end;