Board index » cppbuilder » Re: Why one TImage property effect other components?

Re: Why one TImage property effect other components?


2003-08-05 04:34:19 PM
cppbuilder67
Ruby wrote:
Quote
why when
i change the OnClick Event of one TImage to another name, then
it's changing at the same time also the OnClick Events of all
the other TImages on the form to the same Event name,
If all the TImages had the same OnCLick handles and you change
the name of the OnClick handler than all TImages have still
taht OnClick handler where only the name changed.
Quote
and also
changing the name of the Click event function iteslf??
That is service from the IDE. It's to save you work.
Your problem is more a IDE problem.
Quote
I need to create new Click Event only for one TImage on the form,
when i do that i don't want to see any effect on the other
TImage components that are there...
Ok, in the designer click on that TImage and press <Enter>. You will
get the Object Inspector. Go to the Events tab. You will see behind
OnnClick your function. Delete it there. Be sure to not only delete
it but also place the cursor to an event below. Then doubleclick
on the emptyspace behind OnClick. Now it will produce another
OnClick handler.
Hans.
 
 

Re:Re: Why one TImage property effect other components?

Lot of thanks Hans! :-)
Hans Galema < XXXX@XXXXX.COM >wrote:
Quote
Ruby wrote:

>why when
>i change the OnClick Event of one TImage to another name, then
>it's changing at the same time also the OnClick Events of all
>the other TImages on the form to the same Event name,

If all the TImages had the same OnCLick handles and you change
the name of the OnClick handler than all TImages have still
taht OnClick handler where only the name changed.

>and also
>changing the name of the Click event function iteslf??

That is service from the IDE. It's to save you work.

Your problem is more a IDE problem.

>I need to create new Click Event only for one TImage on the form,
>when i do that i don't want to see any effect on the other
>TImage components that are there...

Ok, in the designer click on that TImage and press <Enter>. You will
get the Object Inspector. Go to the Events tab. You will see behind
OnnClick your function. Delete it there. Be sure to not only delete
it but also place the cursor to an event below. Then doubleclick
on the emptyspace behind OnClick. Now it will produce another
OnClick handler.

Hans.

 

Re:Re: Why one TImage property effect other components?

"Ruby" < XXXX@XXXXX.COM >wrote in message
Quote
why when i change the OnClick Event of one TImage
to another name, then it's changing at the same time also
the OnClick Events of all the other TImages on the form
to the same Event name, and also changing the name of
the Click event function iteslf??
If you simply copy/pasted the TImage to create the other instances, then
they are all linked to the same event handlers still.
Quote
I need to create new Click Event only for one TImage on
the form, when i do that i don't want to see any effect on
the other TImage components that are there...
You need to go to the TImage in the Object Inspector, *clear* the OnClick
event handler first, and then you can reassign it to something else. The
alternative is to alter your source code manually to include the new event
handler, and then use the Object Inspector's drop-down list to select the
new method.
Gambit
 

{smallsort}