Inherited form

P

Patrick McGuire

I have an form that I want to inherit. The inherited
form has a panel control upon which I want to place
controls in the descendent form. How do I do this?

Thanks,

Pat
 
H

Herfried K. Wagner [MVP]

* "Patrick McGuire said:
I have an form that I want to inherit. The inherited
form has a panel control upon which I want to place
controls in the descendent form. How do I do this?

Set the control's (the panel's) 'Modifiers' "property" to 'Public' or
'Protected'.
 
P

Patrick McGuire

This is very frustrating. I had already tried changing
the panel's modifier to protected (I haven't tried public
yet), but it didn't work. The control seemed to be
placed on the panel as a child, but when I debugged the
project, I ended up getting an error (something like):

'The control is not a child of ...'

This was apparently caused by the fact that the Windows
Code generator added only the following lines to the
inherited form's code:

Friend WithEvents TabItemRecord1 As
DEPEQControlLibrary.tabItemRecord
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()

Me.pnlInfo.Controls.SetChildIndex
(Me.TabItemRecord1, 0)


Note that it never added anything like:

me.pnlInfo.Controls.Add(Me.TabItemRecord1).


Anyway, this was YESTERDAY. Today, after making NO
CHANGES to the ancestor form or the UserControl, I simply
opened the project, added a new inherited form, and
placed a UserControl on it, and it worked fine. What is
going on?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top