Delrosss Delrosss - 3 months ago 10
Vb.net Question

How do i make a button in visual basic with a code?

Every time I try to make a button with code, it doesn't show. What's wrong?

Dim NewButton As New Windows.Forms.Button


How do i make it show in Visual Basic 2010?

Answer

The button will not show unless you add it in the form.

Try this:

Me.Controls.Add(NewButton)

Me represents the current form where you are creating the button, you can replace it with the form name in which you want to put it.