var
point: TPoint;
begin
GetCursorPos(@point);
if point.x<Form1.left+Form1.width AND point.x>Form1.left AND point.y<Form1.top+Form1.height AND point.y>Form1.top then
bTemp = True
else
begin
bTemp = False;
FadeOff;
end;
end;
Then make a thread, and write in it:
Code:
var
point: TPoint;
begin
GetCursorPos(@point);
if point.x<Form1.left+Form1.width AND point.x>Form1.left AND point.y<Form1.top+Form1.height AND point.y>Form1.top then
begin
if not(bTemp) then
FadeOn;
bTemp = True;
else
begin
if bTemp then
FadeOn;
bTemp = False;
end;
end;
var
point: TPoint;
begin
GetCursorPos(@point);
if point.x<Form1.left+Form1.width AND point.x>Form1.left AND point.y<Form1.top+Form1.height AND point.y>Form1.top then
bTemp = True
else
begin
bTemp = False;
FadeOff;
end;
end;
Then make a thread, and write in it:
Code:
var
point: TPoint;
begin
GetCursorPos(@point);
if point.x<Form1.left+Form1.width AND point.x>Form1.left AND point.y<Form1.top+Form1.height AND point.y>Form1.top then
begin
if not(bTemp) then
FadeOn;
bTemp = True;
else
begin
if bTemp then
FadeOn;
bTemp = False;
end;
end;
Hope this helped you..
this code wont compile.
1. you have ";" before "else".
2. you do "@point" and this should be "point".
3. you didnt give as the procedures "FadeOn" and "FadeOff".
4. i dont know why but your if is wrong... i think u need to do it like this:
Code:
if (point.x<Form1.left+Form1.width) AND (point.x>Form1.left)
AND (point.y<Form1.top+Form1.height) AND (point.y>Form1.top) then
Kevinnn wrote:
Nope ... nothing called that. Im using Delphi Enterprise 7
but nvm...
put this in timer:
Code:
procedure TForm1.Timer1Timer(Sender: TObject);
var
pt:tpoint;
begin
getcursorpos(pt);//get mouse position
if (Left >pt.x )or (Left+Width <pt.x) or (top >pt.y )or (top+Height <pt.y) then begin
if AlphaBlendValue >123 then//dec AlphaBlendValue
repeat
AlphaBlendValue:=AlphaBlendValue-1;
until AlphaBlendValue =123;
end
else
if AlphaBlendValue <255 then//incAlphaBlendValue
repeat
AlphaBlendValue:=AlphaBlendValue+1;
until AlphaBlendValue =255;
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum