Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP NODEFAULT equivalent in C#?
Message
General information
Forum:
ASP.NET
Category:
Migration
Miscellaneous
Thread ID:
00765703
Message ID:
00779534
Views:
19
Nelson,
I think I understand your question better now but I am not sure I have the answer. Keep in mind that I am very new to C# so this is a case where a blind is leading a blind <g>.

It seems to me that to prevent an object from executing default behaviour you have to assign a delegate method for the event in the class where object/control is used. Then in the method of the delegate event you can override the behaviour. Does it make sense?

>Hi Dmitry,
>
>Thanks for your reply. I see that your sample works well with methods, I'd just like to see a sample that handles Event responses from the base class.
>
>I would like to prevent control's from executing thier default behavior on detection of the occurence of certian events.
>
>VFP handles this easily due to the existence of methods (some sort of event handler) for each event the control response to.
>
>
>
>Thanks again Dmitry...
>
>
>>> Let me attempt to answer your quesiton, if I may.
>
>You can use the keyword "new" to override the base class method. As for example:
>
>public new void KeyPress()
>
>Then if you need to invoke the base method you can do it as:
>
>base.KeyPress();
>
>I hope it answers your question.
>
>>Hi Palem,
>>
>>Thanks for your last reply it helped me solve the problem I had back then. But now I seem to have a similar problem.
>>
>>The problem is that in VFP all Events seem to have an associated method linked to them, in C# this doesn't seem to be the case, that's the reason why the behavior for Events such as KeyPress from the class System.Windows.Forms.TextBox cannot be overriden by simply subclassing the TextBox Control.
>>
>>The bottom question is: How can I control when to execute/not execute the base class behavior for an Event of a control class that has been subclassed from the .NET FrameWork Classes (e.g. TextBoxes)?
>>
>>Thanks in advance.
>>
>>is equivalent to use NODEFAULT() in VFP.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform