On Thu, 10 May 2007 23:22:30 -0700, EmilH <em*****@yahoo. comwrote:
[...]
They both contain button addBut. 2nd is inherited from the first. I want
to
be able to change addBut.Name and addBut.text properties of the second
form
(EditCategory) in the designer. Butchanging modifier to protected didn't
solve the problem. I changed it to public (the most accessible modifier)
before. I'm not even able to delete any control on the inherited form.
Did you change the access modifier for the button field itself? Or did
you change the access modifier for the InitializeCompo nent() method? Your
previous post indicates you did the latter, but it's the former that you
need to do. Changing the modifier from "private" to "protected" should be
sufficient.
As for deleting controls, I don't see any reason that you should expect to
be able to do that. The control is in the base form, not the derived
form. If you could delete the control from the derived form, that would
require removing it from the base form as well, which of course would
screw up that form as well as any other form that inherits it.
Likewise changing the "Name" property of the button. Since the "Name" is
actually used for the name of the field in the base form, you cannot
change it in the derived form, and for the same reasons that you can't
delete the control altogether.
If you don't want a base form control to show, you'll have to add run-time
code to either hide or remove it from the form instance. You do not have
any option for changing the name in the designer, other than changing it
in the base form. However, as with deleting the control, you should be
able to have the Name property of the control in your run-time code (but
at that point, it won't change the in-code name of the field for the
control...just the "Name" property itself).
Pete