Question: how to stop functions from executing twice when using inherited
Windows Forms?
Background:
WindowsForm + forms inheriting from this (base)form.
VB.NET 1.0
Description:
In the BaseForm I've got a procedure which I override in each of the
inherited forms. The procedure controls accessibility of the controls
inherited forms
What happens is that the overriding procedure is called and executed twice.
Why that is I don't seem to work out, nor how to get around it. There is
probably a very clever thought behind this, but I would rather settle with
one execution. Note, that no eventhandlers are defined.
Obviously I can't define the base form as mustinherit, meaning that I must
define the function as overridable with an empty body. I'm sure there is an
easy solution to that, but I don't seem to find any such examples.

Signature
Thankful for any help,
Kenneth Bohman
KennethBohman - 19 Sep 2004 14:17 GMT
I solved the problem. Created a new function for testing purposes. The
signature being exactly the same as for the repeating one. The new one only
fires once, so I just moved the code from the first to the other. I don't
inted to investigate the reasons behind, but I'll keep this experience for
the record.
> Question: how to stop functions from executing twice when using inherited
> Windows Forms?
[quoted text clipped - 16 lines]
> define the function as overridable with an empty body. I'm sure there is an
> easy solution to that, but I don't seem to find any such examples.
Joey Callisay - 20 Sep 2004 06:43 GMT
I don't seem to understand why the function is called twice not unless the
base form form and the inherited form has the same methods and the inherited
form method calls the base's before its own. (e.g. base.MethodName()).
About the base form not being mustinherit (abstract) refer to this link:
http://www.urbanpotato.net/Default.aspx/document/970
> I solved the problem. Created a new function for testing purposes. The
> signature being exactly the same as for the repeating one. The new one only
[quoted text clipped - 22 lines]
> > define the function as overridable with an empty body. I'm sure there is an
> > easy solution to that, but I don't seem to find any such examples.