0

I use Mysql database. I want to create new buttons in vb.net for every data.

When i add new member from admin panel, it must create new button in vb.net.

Any help will be appreciated.

1 Answer 1

1

You can add any control, including buttons dynamically to Control's collection:

At the very basic it looks something like this:

Dim myButton As New Button

MyButton.Id = "btnMyButton"
MyButton.Text = "New Button"

Me.Controls.Add(MyButton)

The values for Id and Text can come from your DB. You will also probably want button something to do - you can add handler for "OnClick" event using "AddHandler" statement.

The approach described above is somewhat universal, but depending on whether you use ASP.NET or WinForms - additional details may need to be coded.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.