Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have One custom control called spin control with UP button click event and DOWN button click event also... I am Using that spin control in another custom control. and then finally i am using that final custom control in my application.. but My quest is how to get that UP button click event in my Application

What I have tried:

tried to get Click event in my application using final custom control
Posted
Updated 28-Jun-16 23:16pm
v2
Comments
Sergey Alexandrovich Kryukov 29-Jun-16 3:29am    
I cannot understand what "archive" may possibly mean, in this context. And what would it possibly mean, to "get an event"? Event instances can be defined as members of some type, invoked in the declaring type; and event handlers can be added to the invocation lists of event instances. Basically, this is all you can do with events. Which part of it is your problem?

Yes, many inquirers have problems with exposing events of nesting controls. The solution is to create appropriate events in the top-level control and add handlers to the inner nested control which invoke those events of the top-level controls. But I'm not sure this is what you try to do.

—SA
[no name] 29-Jun-16 7:08am    
make a public properties of your UP and DOWN button, so that the parent control can access it and listen to event Click.
Ralf Meier 29-Jun-16 16:32pm    
What I understood :
You have a Control1, which has to Buttons in it. Each Button-Click-Event you want to bring to the outside of this control. The same should happen with Control2, which consists of Control1 and perhaps some other controls.
If I'm right, the comment of Sergey should lead you to the goal. But if you stuck at a point you should improve your question with some additional information and the code, which shows how YOU wanted to realize that ...
Member 11559270 30-Jun-16 2:13am    
Yes I have Control1 with buttons. i have used this Control1 in Control2... and that control2 i m using it my application. So i need Button click events of control1 in my application
Ralf Meier 30-Jun-16 13:59pm    
I have read you additional text in your question.
I asked for much more information and also for some code to see, what you have realized until now.
OK ...
What you have to do is : you have to catch the Click-Events (from both Buttons) inside your Control1 and lead them to the outside. That could be done by raising the Click-Event of your Control1. In this case the Sender should be the Button which originally raised the Event - this gives you the ability to see outside the Control1 if the Button-up or the Button-down was pressed.
Have you ever done something like this ?
How much expirience do you have ?
Try to code what I have suggested and improve your question with this code - it makes no matter if this code doesn't work. It gives me the ability to see, what you have done and to make detailled suggestions ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900