Bill,
Your code demonstrates it perfectly. Run it and scroll down to, say, Item_6, so that it is visible in the middle of the box. When you pick it, the focus is now at the bottom, instead of the middle.
Thanks for writing the code to show it!
- Jim
"BillZ" <> wrote:
I think I see the problem now.
Try this and let me know if I'm in the ballpark.
dcl_settings : default_dcl_settings
{ audit_level = 3 ;}
testdcl: dialog {
label = "Test";
:list_box { label = "List box:" ; key = "ebox1" ; height = 5 ; fixed_height = true ; alignment = centered ; } //remarks ok_cancel; } ;;;;;;; ;9/16/03 BILL ZONDLO ;handler for test.dcl ; ; ;-------------------------------------------------; (defun set_lst (val) (setq itm (nth (atoi val) lst1) lst2 nil  

(foreach n lst1 (if (/= n itm) (setq lst2 (cons n lst2))  

 

(setq lst1 (reverse lst2)) (start_list "ebox1") (mapcar 'add_list lst1) (end_list) (if (< (atoi val)(length lst1)) (set_tile "ebox1" val) ;highlighted item (set_tile "ebox1" (itoa (1- (atoi val)))) ;highlighted item  

 

;-------------------------------------------------; (defun c:test ( / dcl_id itm lst1 lst2) (setq dcl_id (load_dialog "testdcl.dcl")) (if (not (new_dialog "testdcl" dcl_id "" cl)) (exit)  

(setq lst1 (list "Item_1" "Item_2" "Item_3" "Item_4" "Item_5" "Item_6" "Item_7" "Item_8" "Item_9" "Item_10" "Item_11" "Item_12")) (start_list "ebox1") (mapcar 'add_list lst1) (end_list) (action_tile "ebox1" "(set_lst $value)") (action_tile "accept" "(done_dialog 1)") (action_tile "cancel" "(done_dialog 0)") (setq ans (start_dialog)  

(unload_dialog dcl_id) (princ)
 
;;;;;;;;;;;;;;Bill