hellswraith
May 24th, 2002, 11:16 AM
Hello everyone, I am hoping someone real good with this c# stuff can help me out.
I am trying to create my own control. I am basing it off of the Panel control. What I want to do is have my control take in image paths (on the hard drive), create a thumbnail of it, and display it on a panel object in a vertical or horizontal fashion, whichever the property is set as. I want all this to be self contained, which is the reason I am creating my own control. When the control is clicked, I want to receive that event inside my control, and process which thumbnail was clicked and do the appropriate actions, then call an event so the user of my control can get the index of the thumbnail that was clicked so they can take actions on it accordingly... Hope that makes sense to you...
Anyway, I KIND OF understand I am going to be using delegates and what nots. I think I got the idea of publishing the event to the user, but I have no idea how to receive the event from the initial click on the control which inherits from the panel control.
Can someone create a SUPER simple user control that inherits from another control and takes the click event from the control, process a little code inside the control, then pass on a custom event to the user? I am lost.
I am trying to create my own control. I am basing it off of the Panel control. What I want to do is have my control take in image paths (on the hard drive), create a thumbnail of it, and display it on a panel object in a vertical or horizontal fashion, whichever the property is set as. I want all this to be self contained, which is the reason I am creating my own control. When the control is clicked, I want to receive that event inside my control, and process which thumbnail was clicked and do the appropriate actions, then call an event so the user of my control can get the index of the thumbnail that was clicked so they can take actions on it accordingly... Hope that makes sense to you...
Anyway, I KIND OF understand I am going to be using delegates and what nots. I think I got the idea of publishing the event to the user, but I have no idea how to receive the event from the initial click on the control which inherits from the panel control.
Can someone create a SUPER simple user control that inherits from another control and takes the click event from the control, process a little code inside the control, then pass on a custom event to the user? I am lost.