Reputation: 1204
Problem:
I cannot add any controls to a groupbox, if the controls were declared in another form.
Background Information:
I have MainForm
which inherits from Form
. It provides some functionality which I need in all of my forms, and have also added some custom controls/images which I need in all of the other forms.
With my forms, I reposition the controls/images from the MainForm
to wherever I need and all is well.
But for some reason, I cannot move these same controls/images into existing GroupBoxes
.
When I say can't I mean that VS is not letting me; when I drag the control over the groupbox, my mouse cursor switches to this "error" sign:
Upvotes: 0
Views: 1088
Reputation: 73462
If I understand correctly then you have two or more level of inheritance hierarchy with your form, base class have the GroupBox
you're trying to modify it in designer via derived form. Am I correct?
In that case VS prevents you to move control to groupbox which is declared in base class?
If yes, There are couple of things to check.
protected
, so that you can access it in derived class.If you have troubles yet make the groupbox as protected internal
and give a try.
Hope this helps
Upvotes: 1