| View previous topic :: View next topic |
| Author |
Message |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Wed Feb 13, 2008 3:52 am Post subject: Image.Click Problem |
|
|
i have a problem, when trying to get Image.Click in delphi i get no response, so the code doesn't work
any ideas why that doesn't work?
_________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Wed Feb 13, 2008 4:38 am Post subject: Re: Image.Click Problem |
|
|
| Snootae wrote: | i have a problem, when trying to get Image.Click in delphi i get no response, so the code doesn't work
any ideas why that doesn't work? |
Someting tells me that it would been a great idea to submit the code?
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Wed Feb 13, 2008 4:51 am Post subject: |
|
|
something like
Image1.click procedure
begin
Application.terminate;
end;
the program doesn't terminate
_________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Wed Feb 13, 2008 4:54 am Post subject: |
|
|
| Snootae wrote: | something like
Image1.click procedure
begin
Application.terminate;
end;
the program doesn't terminate |
Shouldn't it be "Terminate" ?
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Wed Feb 13, 2008 5:03 am Post subject: |
|
|
No, delphi isn't case sensetive.
| Code: | type
...
...
TForm1 = class(TForm)
Image1: TImage;
procedure Image1Click(Sender: TObject);
...
...
private
...
...
public
...
...
end;
...
...
procedure TForm1.Image1Click(Sender: TObject);
begin
Application.Terminate;
end; |
Works just fine.
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Wed Feb 13, 2008 5:09 am Post subject: |
|
|
| Symbol wrote: | No, delphi isn't case sensetive.
| Code: | type
...
...
TForm1 = class(TForm)
Image1: TImage;
procedure Image1Click(Sender: TObject);
...
...
private
...
...
public
...
...
end;
...
...
procedure TForm1.Image1Click(Sender: TObject);
begin
Application.Terminate;
end; |
Works just fine. |
Very well than i have no idea why it dosen't work
You could use instead if you wont get it workin
edit :
Huhh? Symbols code wasn't shown when i replied. Pretty odd.
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Feb 13, 2008 5:13 am Post subject: |
|
|
Naablet, you have been warned and banned twice already for this same very reason. Stop replying to threads if you haven't got a clue on helping. Your spamming in this section is not getting you anywhere and post count means nothing on these forums.
_________________
- Retired. |
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Wed Feb 13, 2008 5:49 am Post subject: |
|
|
Hey,
First you should check if the procedure even gets conducted.
So, just put a MessageDlg or ShowMessage in the procedure.
like
| Code: | procedure TForm1.Image1Click(Sender: TObject);
begin
ShowMessage('yay');
end; |
if it doesn't work, you perhaps didn't add the procedure to the OnClick function of the Image, or it disappeared for what even reason.
But if THIS works but Application.Terminate doesn't then just use "Close;" instead of.
If you still can't get it working, then it could be because the image is behind something, click rightclick on it and then "Bring to front" or so.
Else, no clue..
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Wed Feb 13, 2008 6:57 am Post subject: |
|
|
at reak, thanks, im trying (couldn't be bothered before)
i assume my images were at the front since i could seem them in the designer, but ill check anyways
thanks guys
Edit: damn, still wont work, this is really annoying
heres just an example of the source:
| Code: |
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MPlayer, ExtCtrls, StdCtrls, GIFImg;
type
TForm1 = class(TForm)
ImageClose: TImage;
procedure ImageCloseClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ImageCloseClick(Sender: TObject);
begin
ShowMessage('WOrking yet!!');
end;
end. |
P.S. this stuff was almost entirely automatically generated, so i cant see any reason why it refuses to work
_________________
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Wed Feb 13, 2008 8:11 am Post subject: |
|
|
are you sure that you declared the OnClick procedure of the picture to this porcedure?
Like this?
click
If so, readd the TImage component. Sometimes it's bugged because what even reason.
I also had a problem smiliar to this, I tried to figure it out like 1.5 hours...and then I just had to readd the component and it worked.
|
|
| Back to top |
|
 |
Renkokuken GO Moderator
Reputation: 4
Joined: 22 Oct 2006 Posts: 3249
|
Posted: Wed Feb 13, 2008 11:23 am Post subject: |
|
|
| *cough* C *cough*.
|
|
| Back to top |
|
 |
|