Einzelnen Beitrag anzeigen

Benutzerbild von daniel-h
daniel-h

Registriert seit: 9. Sep 2008
Ort: b.
170 Beiträge
 
Delphi 7 Enterprise
 
#7

Re: Viele OnMouseMove Proceduren | elegantere Lösung

  Alt 29. Jun 2009, 18:43
alles klar:
Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, jpeg, ExtCtrls, ComCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Label1: TLabel;
    Shape1: TShape;
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure FormMouseLeave(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


procedure verstecken;
begin
    SetWindowLong(Application.Handle, GWL_EXSTYLE,

                GetWindowLong(Application.Handle, GWL_EXSTYLE)

                or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);


end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  verstecken;
  form1.Width := 1;
end;

procedure TForm1.FormMouseLeave(Sender: TObject);
begin
  form1.AlphaBlendValue := 1;
  form1.Width := 1;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  form1.Width := 200;
  form1.AlphaBlendValue := 255;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
label1.Caption := TimeToStr(time);
end;

end.
und:
Delphi-Quellcode:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas{Form1};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
  Mit Zitat antworten Zitat