Question add button in code?

apricotx

New member
Joined
Jan 10, 2010
Messages
3
Programming Experience
1-3
I'm working on a project that will create new windows components. (If this is possible).

I have made a button that creates new forms when clicked in the MDI container.

Now I'm just wondering if someone can figure out a code to make it so when I click a button it creates a new button on the new created form.
Please help me, much appreciated.

what I need to know for example is:

I made the button create a new form.
Now I want my other button to add a control (such as another button) to that
previously created form.

If your wondering about my code here it is:

VB.NET:
Dim count1 As Integer = 0
    Private Sub NewButtonToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewButtonToolStripMenuItem.Click
        Dim NewButton As New Button
        NewButton.Text = ("Button ") & count1
        NewButton.Show()
        count += Val(1)
 
Hard code! MDI application please help!

I'm working on a project that will create new windows components. (If this is possible).

I have made a button that creates new forms when clicked in the MDI container.

Now I'm just wondering if someone can figure out a code to make it so when I click a button it creates a new button on the new created form.
Please help me, much appreciated.

what I need to know for example is:

I made the button create a new form.
Now I want my other button to add a control (such as another button) to that
previously created form.

If your wondering about my code here it is:

Code:
VB.NET:
Dim count1 As Integer = 0
    Private Sub NewButtonToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewButtonToolStripMenuItem.Click
        Dim NewButton As New Button
        NewButton.Text = ("Button ") & count1
        NewButton.Show()
        count += Val(1)
 

Latest posts

Back
Top