In my project, I’m adding a ListBox whose items are retrieved from a database. What I want to do is to add a button to the right of each item on the ListBox that, when pressed, deletes that item from the database and refreshes the ListBox.
Now, getting the button to do that will be easy (quite possibly a Click() event on the button), but my problem is that I can’t find a way to actually add a button to the ListBox.
Does anyone know how to do this?
BTW this is in a VB desktop app project.
A DataGridView would be an easier solution, it already includes all the functionality you require. Simply add a text column and a button column, then you can subscribe to the Cell ContentClick event For example: