Visual C#: How to add controls to a form created with code?
<p>I'm new to Visual C# and I'm currently stuck on how to create a new form (with code, not design) and add things (namely labels and textboxes) to this new form. Here's what I have right now:</p>

<pre><code>namespace AccountInfo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            profileForm profile = new profileForm();  // Make new form
            profile.Name = "newProfile";
            profile.Text = "Add a new profile";
            profile.LabelText = "test";
            profile.Show();             // Display form
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }

    public class profileForm : Form
    {
        // Controls
        Label label1 = new Label();

        public profileForm()
        {

        }

        public string LabelText
        {
            set { label1.Text = value; }
        }

        private void profileForm_Load(object sender, EventArgs e)
        {

        }
    }
}
</code></pre>

<p>When I run this code, I get the default form and I click button1. It brings up a new form, but with nothing on it. I expect a label to show up but it won't. I've tried this multiple different ways (this being my most recent method) and I can't get anything to show up. I've looked around StackOverflow and one other topic came up, but its solution didn't work for me. I'd appreciate any insight into this :) Thanks a ton!</p>

<p>Edit: I've also tried this using the constructor instead. It didn't help.</p>
