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
|
Posted: Sun Dec 02, 2007 11:38 pm Post subject: 2 Delphi Questions |
|
|
The first one is :
How can I change the picture of a Picture tool when my mouse is over it and when I click on it. I also need it to work when other people download my program but not take too much memory.
Second one is:
For some odd reason I can't figure out how to center the text in an Edit tool and I know this is really basic.
Thanks.
|
|
Back to top |
|
 |
killersamurai Expert Cheater
Reputation: 0
Joined: 10 Sep 2007 Posts: 197 Location: Colorado
|
Posted: Mon Dec 03, 2007 1:47 am Post subject: |
|
|
To change the picture when your mouse is over the TImage, you add a OnMouseMove event. For the mouse click, you can do either OnMouseUp or OnMouseDown event. I don't think you can align text in a TEdit unless you add that into the component. I would just use a TMemo and filter out the return(enter) key if you want to keep it one line.
|
|
Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Dec 03, 2007 2:10 am Post subject: |
|
|
1. You need to send them the picture or add all the picture to your project(with .rc file).
2.I think it can't be done in delphi.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Mon Dec 03, 2007 7:13 am Post subject: |
|
|
2: Use a tmemo instead and set allignment to taCenter
and set wantreturns and wordwrap to false
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Mon Dec 03, 2007 8:01 am Post subject: |
|
|
Thanks DB.
HolyBlah wrote: | 1. You need to send them the picture or add all the picture to your project(with .rc file).
2.I think it can't be done in delphi. |
How would I be able to put the pictures in an .rc?
|
|
Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Dec 03, 2007 8:35 am Post subject: |
|
|
Never Again wrote: | How would I be able to put the pictures in an .rc? |
Make a blank .rc file. rc syntax is ID, ResourceType, Name. For example, if I want to put a bitmap called tomato in my project
Code: |
IDTOMATO BITMAP "c:\tomato.bmp"
|
Suppose I named the rc data.rc, I would put the following directive in my project
Code: |
{$R 'data.res' 'data.rc'}
|
so data.rc is compiled to data.res and is linked with the other delphi object files. If you want to use the bitmap with functions like FindResource you then just put in FindResource(SysInit.HInstance, "IDTOMATO", RT_BITMAP);
_________________
|
|
Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Mon Dec 03, 2007 11:55 am Post subject: |
|
|
or simply put 2 pictures, with 1 invisible.. then..
image2.visible := true;
image1.Visible := false;
can use a easy aling holding alt.
_________________
|
|
Back to top |
|
 |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Mon Dec 03, 2007 4:58 pm Post subject: |
|
|
appalsap wrote: | Never Again wrote: | How would I be able to put the pictures in an .rc? |
Make a blank .rc file. rc syntax is ID, ResourceType, Name. For example, if I want to put a bitmap called tomato in my project
Code: |
IDTOMATO BITMAP "c:\tomato.bmp"
|
Suppose I named the rc data.rc, I would put the following directive in my project
Code: |
{$R 'data.res' 'data.rc'}
|
so data.rc is compiled to data.res and is linked with the other delphi object files. If you want to use the bitmap with functions like FindResource you then just put in FindResource(SysInit.HInstance, "IDTOMATO", RT_BITMAP); |
When I made the .rc and tried to compile my project it said "[Error]Couldn't find data.res" how can I fix this?
|
|
Back to top |
|
 |
|