I have followed the steps here http://msdn.microsoft.com/en-us/library/ms185301.aspx to create a wizard that allows me to use a custom string when creating a new project from my Visual Studio Template.
But this example adds a textbox to the wizards Form like so:
public partial class UserInputForm : Form
{
private string customMessage;
private TextBox textBox1;
public UserInputForm()
{
textBox1 = new TextBox();
this.Controls.Add(textBox1);
}
public string get_CustomMessage()
{
return customMessage;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
customMessage = textBox1.Text;
this.Dispose();
}
}
I want my Dialog to be a little bit more detailed so I have used the Dialog editor to drop a Textbox on like so:
This causes the following auto generated code to appear:
Now when I do this I notice that the newly dropped textbox does not appear when I create my project. Only the one that has been specified in the Constructor like so:
Why is this so? I want to add lots of text boxes and labels on the wizard so I don't want to be having to do this all in code in the constructor.