doctorjellybean
Programmer
- May 5, 2003
- 145
I have 2 listboxes: one which contains filenames and the other folder locations. A button is used to add a filename via opendialog to the listbox, while clicking on a listbox containing folders adds the folder.
The selections work in pairs, e.g. Folder A goes with File A, Folder B with File B, etc.
Now I want to add an Undo, where if the user makes a mistake, the last addition is removed. He can't e.g. remove Folder A in the above example, as it is paired with File A and other pairs have already been added. So all I need to do is create an Undo for the last addition (in this case Folder C), at which point the Undo will be disabled until a new addition has been selected.
I thought about selecting the last item in the listbox directly, but I don't know how to only have the last item clickable and not the others.
Thanks in advance.

The selections work in pairs, e.g. Folder A goes with File A, Folder B with File B, etc.
Now I want to add an Undo, where if the user makes a mistake, the last addition is removed. He can't e.g. remove Folder A in the above example, as it is paired with File A and other pairs have already been added. So all I need to do is create an Undo for the last addition (in this case Folder C), at which point the Undo will be disabled until a new addition has been selected.
I thought about selecting the last item in the listbox directly, but I don't know how to only have the last item clickable and not the others.
Thanks in advance.