4

Anyone come up with a way that I can design a panel without a form?

On the surface usercontrol doesn't seem the way to go.

Background: I come from a text editor world and VS is new to me. We did everything with panels instead of forms. So open for learning. Specifically have a base class panel (ExtendedPanel) that defines some basic controls: Cancel, Save, Save and Close. This ExtendedPanel then will be used for ClientExtendedPanel that is tied to a bindingsouce clientBindingSource. This is all tied to my entity framework model. So I will add, edit and delete sql datarows for my Client table. If no changes have happened by Save button will not be enabled. If I make a change but hit cancel it will warn me. I've done all this before but since I left that company I don't have access to the code base and they didn't use VS (text editor only)so it wasn't really transportable anyway.

All that background so I can ask: Is usercontrol the way to go, or is there something that will allow me to visually add controls to a panel like it is a form?

Brian Hanf
  • 544
  • 2
  • 11
  • 31

1 Answers1

2

Yes, a UserControl provides a form-like canvas in the designer for you to add other controls (buttons, etc).

You can do this too by inheriting a panel and writing the code to add the buttons and wire their events, etc, but you won't get the designer support.

LarsTech
  • 80,625
  • 14
  • 153
  • 225
  • User control had some issues for what I was doing but looks to be the answer for the question over all. thanks. – Brian Hanf Aug 16 '12 at 20:35