Touyoo Touyoo - 1 year ago 123 Question

Add button to a GroupBox

i have a problem. I have a button who is creating an other button, but i want that the new button will be in a groupbox, but it's not working, the button is replacing all of the groupbox.

Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
Dim button As New Button
button.Location = New Drawing.Point(10, 500)
button.Size = New System.Drawing.Size(171, 23)
button.Text = TextBox1.Text

End Sub


Answer Source

Here you are adding the GroupBox to the Button, not the other way around.


Is what you want.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download