How do you add controls through code instead of the form editor? I wasnt to do things like make a textbox appear when a button is pressed, but I'm looking for another way to do it than make a huge clutter of controls and edit the VISIBLE statement.

Something like:

Private Sub Button1_Click

delete button 3
create button 4

End Sub

Recommended Answers

All 2 Replies

Dim aButton As New System.Windows.Forms.Button()
FormName.Controls.Add(aButton) 'change FormName To Whatever You Named Your Form
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.