المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Create click event for Class



C# Programming
05-29-2010, 08:00 PM
Hi everyone

I have a question about creating a click event for a class. Thing is I have created a UserControl which takes images and arranges them dynamically given certain circumstances. This control uses a list of 'Viewports' (basically rectangles which carry an image). I would like to create an event for this Class 'Viewport'. Currently i use the click event of UserControl and loop through the list, checking the regions of these viewports. I thought I could do better than this and give each port it's own event without having to loop. Is this possible? I was thinking in the direction of an API, but all ideas are welcome.

Thanks

Steven Solberg