I’ve been messing around with Xojo for a while and made a few projects, most of my problems are solved from the xojo docs, but im stuck now.
Currently i have a listbox with a few folders with some info indexed in and i had the thought of deleting the folder when a button is pressed as long as the folder is selected.
My Code:
ListBox1:
Cell Text Paint:
[code] if column = 0 then
g.Bold = true
g.TextSize = 14
and i have a button that is supposed to delete the folder when selected but that clearly doesn’t work and i’m nothing near a solution after hours of messing around with code.
[quote=347269:@Jean-Yves Pochez]we could surely help if you provide the code in the action event of the button that does not work as expected …
all the code you posted is working ![/quote]
i don’t have any code in the button since none of it was close in anyway so when i gave up, so the button is just functionless atm
my code is still the same from my first post, but i have this in my button.
currently this is the only way the app runs without crashing on launch but it crashes as soon as i press the button…
if lst.ListCount > 0 then
For i As Integer = lst.ListCount-1 DownTo 0
If lst.Selected(i) Then
If lst.RowIsFolder(i) And lst.Expanded(i) Then lst.Expanded(i) = False
lst.RemoveRow(i)
End If
Next
End If
For multi-row deletion, what Neil has presented is the most important aspect of such a method - you must remove from the highest numbered row down instead of from row 0 up. Removing from the bottom up will reorder the remaining rows and your selected row numbers will change.