Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to change the picture when mouse over it? (Delphi)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Never Again
I post too much
Reputation: 0

Joined: 13 Jan 2007
Posts: 2000
Location: New Mexico

PostPosted: Tue Oct 16, 2007 9:37 pm    Post subject: How to change the picture when mouse over it? (Delphi) Reply with quote

How would I be able to change the picture of a button from something like a green button to a blue button when I put the mouse over it?
Back to top
View user's profile Send private message MSN Messenger
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Tue Oct 16, 2007 9:47 pm    Post subject: Reply with quote

Procedure (objectname)mousemove(Sender : Tobject);
begin
/// code here.
end;
Back to top
View user's profile Send private message AIM Address MSN Messenger
Never Again
I post too much
Reputation: 0

Joined: 13 Jan 2007
Posts: 2000
Location: New Mexico

PostPosted: Tue Oct 16, 2007 9:56 pm    Post subject: Reply with quote

I know that, but what would the code be?
Back to top
View user's profile Send private message MSN Messenger
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Wed Oct 17, 2007 5:26 am    Post subject: Reply with quote

here:
Code:
procedure TForm2.Image1MouseEnter(Sender: TObject);
begin
image1.Picture.LoadFromFile('bluebutton.bmp');
end;

procedure TForm2.Image1MouseLeave(Sender: TObject);
begin
image1.Picture.LoadFromFile('Greenbutton.bmp');
end;
Back to top
View user's profile Send private message
Never Again
I post too much
Reputation: 0

Joined: 13 Jan 2007
Posts: 2000
Location: New Mexico

PostPosted: Wed Oct 17, 2007 6:59 am    Post subject: Reply with quote

I get an error "Undeclared identifier" when I try that.
Back to top
View user's profile Send private message MSN Messenger
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Wed Oct 17, 2007 2:37 pm    Post subject: Reply with quote

did u put an image component?
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Wed Oct 17, 2007 4:26 pm    Post subject: Reply with quote

If you copy and pasted the code from HolyBlah, you need to learn the basics of objects.


My 2 cents:

You need to figure out what component you're using first. Your average TButton can't have it's color changed by beginner means. I'd suggest using a picture component as a button, or a speedbutton with 'flat' set to True and have a picture component beneath the button which you can change the color of on the speedbutton's mousemove/mouseover event(s).

I may be wrong on a few variable names, haven't messed with Delphi in a while.

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites