You guys are probably way ahead of me but I can't understand what you are trying to do.
If you are talking about VB.NET Windows Forms Controls what is the point of creating a derived control and using an event to refer to an event in the base control which responds to virtually the same fire?
What is the "OnClick Event"? There is an OnClick method in HTM but all the standard controls I have ever seen have the Click Event.
If your object is to use several derived controls and save coding why not juse use an ordinary Sub?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
taxes the reason for me is that I'm actually creating two controls.
The first control acts as a container for the second control im designing. And because I want some kind of relationship between to the two controls I need a way.
When my child control is clicked, the parent container control needs to do something.
I managed to solve my problem though
When the control mousedown event is fire, I would raise an event.
Then on the parent control, I would capture that event and do the necessary actions I needed.
Originally posted by Geespot I managed to solve my problem though
When the control mousedown event is fire, I would raise an event.
Then on the parent control, I would capture that event and do the necessary actions I needed.
Which just happens to be the correct way of doing it...
I wish I could think of something witty to put in my sig...
Originally posted by Geespot taxes the reason for me is that I'm actually creating two controls.
The first control acts as a container for the second control im designing. And because I want some kind of relationship between to the two controls I need a way.
When my child control is clicked, the parent container control needs to do something.
I managed to solve my problem though
When the control mousedown event is fire, I would raise an event.
Then on the parent control, I would capture that event and do the necessary actions I needed.
OK.
For my education please. Would not either of the following suffice?
1. In the Click event of the second control, call the click event of the first control
2. Add the click event of the second control to the handles of the first control click event. (Or is that what you mean by "Capture" which is the generic name for a VB.Net class/method?)
And what's the "OnClick Event"? I know it's purpose is obvious but is is a custom event you have written?
Many thanks for your response.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Is that restricted to inherited controls? I have only inherited forms and there is no OnClick etc. event involved there.
I must experiment.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
In the object combo select (Overrides)
In the event combo you should have several OnWhatEver events.
Thanks,
I've never looked in the Overrides section
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.