Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overriding click event in C# forms
Message
From
08/03/2007 17:16:00
 
 
To
08/03/2007 12:42:08
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01201869
Message ID:
01202136
Views:
10
Bonnie,

I had a feeling that the question would be more appropriate for .NET forum , but since Foxpro behaviour was involved decided to send to this category.
Yes , thanks, delegate was set up twice and after commenting it in a parent Form Foxpro behaviour was achieved. What I didn't like though is that I had to comment in Designer generated code. Surely more control how inheritance works , but it is not purely visual.

Michael

>Michael,
>
>You'd probably be better off posting this kind of question in the .NET forum here instead of in the Fox forum. This particular category (VFP and .NET) is more for questions relating to VFP working with .NET and vice-versa.
>
>But, that's ok for now ... I'll give you a hand here.
>
>This *should* work, so I'm guessing that something else is causing the button's click event to fire twice. I think I need to see more of your code (I'm thinking possibly you've set up a delegate to the twButton1_Click event handler in both Form1 and Form2 and you wouldn't need to do that in this case).
>
>~~Bonnie
>
>
>
>>The following snippet results in showing "Clicked 2" twice if we inherit from Form2 which can't explain. Without overriding both "Click 1" and "Click 2" are shown.
>>
>>
>>
>>   public partial class Form1 : TWForm
>>    {
>>
>>        internal virtual void twButton1_Click(object sender, EventArgs e)
>>        {
>>            MessageBox.Show("Clicked 1");
>>        }
>>
>>   public partial class Form2 : Form1
>>    {
>>
>>...
>>        internal override void twButton1_Click(object sender, EventArgs e)
>>        {
>>
>>            MessageBox.Show("Clicked 2");
>>        }
>>    }
>>
>>
>>
>>Any idea how to achieve Foxpro behaviour to show "Click 2" just once or explain how it works or give a reference to explanation.
>>
>>
>>TIA
>>Michael
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform