First, make your "template" form.
Next, add a 'new item' to the project. When the "Add New Item" dialog comes up, look for "Inherited Form".
Click OK.
A new dialog "Inheritance Picker" should appear. Select your template form and click OK.
You should now have a new form that looks just like your old form.
Unfortunately, controls are declared 'friend' by default, so you wont be able to move anything. This may not be an issue if you can configure everything on the template for with anchors. But, if you need to have more control...
In the solution browser click the "Show All Files" button.
Browse to your template form and click the "+".
select the form.Designer.vb file and switch to code view.
Look for a block of declarations like:
Code:
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend allows access to the controls from the assmebly, but it doesn't give the inheriting class full control over them. So you want to add the word 'Protected' to the front of the declarations. Protected means that any class that inherits this class will have full control over that object. So it should look like this:
Code:
Protected Friend WithEvents Label6 As System.Windows.Forms.Label
You'll have to do that for any controls that you want to be able to move.
Rebuild the project (Ctrl-F5).
Now when you go back to your form that looks like the template, you should be able to move controls around.
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
I believe in killer coding ninja monkeys.![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)