The command would be:

did -d $dname 1 $did($dname,1).sel

As for keeping the values stored that can be done like this:

Code:
on *:DIALOG:listbox:init:0:{
  did -a $dname 5 %listbox5
}
on *:DIALOG:listbox:close:0:{
  set %listbox5 $did($dname,5).text
}