Add a button in a Cell's Listbox

Is there an easy way to add a button in a Cell of a ListBox ?

I want to add a delete button to delete a row in my ListBox

Thank you for help

I know how to do it in API 1, but sorry I don’t know in API 2.
may be someone else ?

I’m looking a solution for Desktop and Mobile appp

What about a keyboard shortcut ?
(I do not know if such beast exists for Mobile, but since it is another project…)

For desktop it a solution. I but my button at bottom of the listbox with some shortcut


Look at how Xojo IDE deals with it in the New Project window (how to remove a Recent from the list).

I implemented Cmd-Del to remove the selection * (since far before Xojo) and I am really happy with that. Now, it is your project.

  • One or many Selected Rows.

This example helped me a lot to do what you want to do.

1 Like
1 Like

Paint a button picture in CellBackGroundPaint, and use CellClick for the button Pressed.

Don’t forget visual feedbacks, like when the button is pushed (e.g. darker gray). Not only is it expected, but the user can know when (s)he moves the mouse out of the button (like when changing mind while clicking) whether the action will occur (and whether the button is actually enabled).

1 Like

This is exactly what I do and think it looks good and works well



Review ?

You wrote in the beginning:

I want to add a delete button to delete a row in my ListBox

The person with the screenshot (Review) is not the same as the OP (button to delete).

1 Like

Thanks Alberto. I will clean my glasses (sorry).:nerd_face:

:slight_smile: Yes, I was just illustrating how I am using a drawn button in a listbox. Mine will open a new window for the student to review their test. For the OP, he can change the text to Delete and make the appropriate changes in CellClick to delete the row and from the table

1 Like