M
Marco [Stinger]
Hi
I'm developping a Compact Framework, VS 2003 C# project for WinCE 5.0
One functionality requires that I create dynamically some controls out of a
XML project file, so I have some controls arrays (Buttons, PictureBoxes,
ListBoxe
and so on..) and I create the controls dynamically reading the XML.
Some of this controls require to respon to the click event, witch is fairly
simple : Object.Click += new EventHandler(NomeHandler);
My problem is if I connect some (let's say) PictureBox[n].Click to the
same EventHandler I don't know witch PictureBox called the Event !!!!!
Being fairly simple (
) I though I was going to put the array ID in the
tag propiety
of the control, and read it in the Event Handles....but Compact Framework
DOEAS NOT
have the tag property ( sig sig ).
So I came up with 2 possible solutions :
1) BRAND NEW CONTROLS
I could create my controls (MarcoButton, MarcoList, MarcoPictureBox etc
etc ) adding the int ArID property, but I'd like to think there's a simpler
and faster
solution.
2) PASS CUSTOM PARAMETERS to the EVENT HANDLER
I should be able to pass (maybe using EventArgs) some custom parameters to
the EventHandles...I did some researches on the Internet but I haven't found
any
solution yet....
Con you help me on Solution 2 ??.
Thanks in Advance and have a nice WeekEnd
Marco
I'm developping a Compact Framework, VS 2003 C# project for WinCE 5.0
One functionality requires that I create dynamically some controls out of a
XML project file, so I have some controls arrays (Buttons, PictureBoxes,
ListBoxe
and so on..) and I create the controls dynamically reading the XML.
Some of this controls require to respon to the click event, witch is fairly
simple : Object.Click += new EventHandler(NomeHandler);
My problem is if I connect some (let's say) PictureBox[n].Click to the
same EventHandler I don't know witch PictureBox called the Event !!!!!
Being fairly simple (

tag propiety
of the control, and read it in the Event Handles....but Compact Framework
DOEAS NOT
have the tag property ( sig sig ).
So I came up with 2 possible solutions :
1) BRAND NEW CONTROLS
I could create my controls (MarcoButton, MarcoList, MarcoPictureBox etc
etc ) adding the int ArID property, but I'd like to think there's a simpler
and faster
solution.
2) PASS CUSTOM PARAMETERS to the EVENT HANDLER
I should be able to pass (maybe using EventArgs) some custom parameters to
the EventHandles...I did some researches on the Internet but I haven't found
any
solution yet....
Con you help me on Solution 2 ??.
Thanks in Advance and have a nice WeekEnd
Marco