Getting button ID from flowlayoutpanel
Hi,
I have a flowlayoutpanel which is populated with image buttons from an array. Is it possible to access some sort of 'button id' when it is clicked, that corresponds to it's place in the array?
Further info:
This wasn't a problem at first because all my jpgs were in the same directory so I could grab the ctrl.text and identify the file I wanted from that. However my script now implements a getFilesRecursive function and I can't tell where each button/file comes from, but the array would tell me this.
Cheers,
Alex
Comments
Cheers
Perfect! I saw the tag property, and was unsure how it was used.
Thanks for your help,
Alex
...
In .net tag property you can put anything (variables, arrays, values, controls etc.) Probably you noticed that event fn's not allow local variables. Using tag's is one way to solve that problem. Read also this mxsHelp topic about dotNetMxsValue
bga
...
Hey Alex,
set Tag property of image buttons to be flowlayoutpanel which containes theses imgButtons.
Examle :
--------------------------------------
flp = flowlayoutpanel
imgBtn = image Button
imgBtn.Tag = flp
Now you can assigne event to the img buttons
bga