Updating text in listbox with radio button click

  1. 7 months ago

    This seems like it should be pretty straightforward, but I am unsure where to put the code to make this happen.
    I have a listbox with a bunch of file names. When I click one of 2 radio buttons I'd like the file names to change, and append some text to the end of the name.

    What event handler would I attach this to?

    action of the radiobutton.

  2. Jean-Yves P

    26 Nov 2019 Testers, Xojo Pro Answer Europe (France, Besançon)

    action of the radiobutton.

  3. Gavin S

    26 Nov 2019 Testers, Xojo Pro, Forum Moderators, MVP UK

    http://docs.xojo.com/RadioButton.Action

    Then you could use http://docs.xojo.com/ListBox.CellValueAt or simply rebuild the whole ListBox.

  4. @Jean-YvesPochez I tried that but it didn't work.
    @Gavin S ok, CellValueAt is a new one for me. I'll give that a try.

    Just to confirm, does ListBox.Refresh not do anything??

  5. @Gavin S http://docs.xojo.com/RadioButton.Action

    Then you could use http://docs.xojo.com/ListBox.CellValueAt or simply rebuild the whole ListBox.

    Ok so this appears to be in the new version. We are still on 2018 as we haven't updated all of our apps yet...
    How would I accomplish this in another way?

  6. Gavin S

    26 Nov 2019 Testers, Xojo Pro, Forum Moderators, MVP UK

    @michael m Ok so this appears to be in the new version. We are still on 2018 as we haven't updated all of our apps yet...
    How would I accomplish this in another way?

    https://docs.xojo.com/ListBox.Cell

  7. Jean-Yves P

    26 Nov 2019 Testers, Xojo Pro Europe (France, Besançon)

    the action event of the radiobutton send a redraw to the listbox
    the listbox redraws itself based on the radiobutton value.
    or
    the radiobutton action event redraws the listbox based on its value.

or Sign Up to reply!