0

Friends,
I have an array of TEdits.
They all use the same On Key Down method.

How can I determine (from within my On Key Down method) which TEdit called the method ?

Thanks,

2
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by John A
0

Well, within TEdit::OnKeyDown(), you'll be able to use this to refer to the object.

For the exact spot in the array, you'll have to use a find algorithm based on the this pointer. To simplify that, you could just keep the element number in a variable stored in the object.

0

How can I find the ->Tag I assigned to the TEdit box ? That would determine which box the call came from...

Tx.

0

How can I find the ->Tag I assigned to the TEdit box ? That would determine which box the call came from...

I have no clue which class ->Tag belongs to. (Perhaps you could explain a little bit more how your classes are organized.) If it's in the TEdit class, you wouldn't even need this pointer. You could simply refer to it as *Tag within your OnKeyPress member function.

If Tag is not in TEdit, you'll be better off just creating a pointer to Tag within TEdit, and then accessing it inside OnKeyPress.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.