I have a an inherited form that has a panel control on it. I want to paste other controls onto this panel but the paste option is grayed out and won't let me do it. I made sure that the template form did not lock the panel. I'm stymied from making progress until I can get this resolved. Also, dragging and dropping doesn't work either. Anyone have any ideas?

Recommended Answers

All 2 Replies

Member Avatar for Unhnd_Exception

Go to the base form and click on the panel. Set the modifiers property to protected friend. Add a new form to the project and make it inherit from the base form. You will get an error saying the class can't be different then the base class. Click on show all files in the solution explorer and click the .designer file for the new class and change inherits System.windows.form to your base form. You should have no problems.

I created Form2. Added a panel to it and change the modifiers property. I added a new form named Form3. I set it to inherit Form2. Heres a screen shot of Form3's designer code that needs to be changed.

As for Form3 class it should just be

'Just inherit from Form2 after you add this form
'then change the designer file to inherit from
'Form2 also.
Public Class Form3 : Inherits Form2

End Class
commented: sux for you to get another -=1 from.Me, just.because I can :D -3

Hey Unhnd, you da man! or woman.

It worked beautifully. I didn't get the error message you predicted and when I went to the designer of the inherited form to change the inherits from statement it was already as you wanted it. So, all I needed to do was change the modifiers property.

I'm pretty certain I would have figured this out on my own. Sometime between now and the year 2050.

I'm back in business. I'm new to daniweb so I don't know the properway to close things out but will figure it out. Thank you very much Unhnd.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.