Dynamic component

I'm using C++ Builder. I created a few TMenuItem and assigned event OnClick each TMenuItem to one function. Now I don't know, how can I get information, which component run this function. I want to have access to field of component(for example: Caption or ItemIndex, etc). Thanks for all.
I know :) I have to use dynamic_cast operator
In Borland C++ builder,
if u want to access any companents of Form
use like this:
1
2
Form1->Edit1->Caption = "Test";
Form1->Button1-><any fields> = "Test";         

Last edited on
Topic archived. No new replies allowed.