private: System::Void GOBUT_Click(System::Object^ sender, System::EventArgs^ e) {
int x;
x = sender->Location.X;
}
returns error saying Location is not a member of Object^.
If you don't understand what i want to do :
I'm trying to create an array of button (user/runtime created buttons) and get different interpretations of the click event depending of wich button is clicked.
For example, if we create buttons[0] I wish to get the 0 or something relevant into the GOBUT_Click event.
I think you're right for Managed C++,
however this forum is mostly empty, I think I would not get an answer there.
Sure you will. Trust me...
EDIT : Returns conversion error. Object^ to Button^
How can I associate the right index of my button array to it?
Not really surprising: You're trying to do a plain assignment instead of casting (see my example in post #3). In the context of your latest snippet, you need to change the offending line to this:
Code:
IDBut = safe_cast<Button ^>(sender);
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Bookmarks