select a position in a list box

Started by TopoWAR, August 27, 2014, 12:56:24 PM

Previous topic - Next topic

TopoWAR

Hi, I have a question, in a list box you want to select a position x, in this case "Número  YX" but I select "Número  YXZ" how do I select the position you want on the list?

Code (autolisp) Select
(list "Número X Y Z Descripción"
      "Número Y X Z Descripción"
      "Número X Y Z"
      "Número Y X Z"
      "Número X Y Descripción"
      "Número Y X Descripción"
      "Número X Y"
      "Número Y X"
      "X Y Z Descripción"
      "Y X Z Descripción"
      "X Y Z"
      "Y X Z"
      "X Y Descripción"
      "Y X Descripción"
      "X Y"
      "Y X")


I have dealt with these you run but do not give me the result I want

thank you
Code (autolisp) Select
(dcl-ListBox-SelectString TopoWAR/form_exp/formato "Número Y X")
(dcl-ListBox-SelectItem TopoWAR/form_exp/formato 7 t)


for now I solved using a loop to find the position I seek
Code (autolisp) Select
(setq cont -1)
    (while (/= (dcl-ListBox-SelectString TopoWAR/form_exp/formato (setq formato_t (nth formato_n formato)) cont) formato_n)
      (setq cont (1+ cont))
    )
http://topowar.org - Programa para Topografía y Catastro para Costa Rica.

DW

I ran into the same problem before - how about...

Code (autolisp) Select
(dcl_ListBox_SelectItem TopoWAR/form_exp/formato (dcl_ListBox_FindStringExact TopoWAR/form_exp/formato  "Número  YX" ) t )

TopoWAR

what I need is to select an item in the list, I mark it in the list, the previous loop I fixed that,
http://topowar.org - Programa para Topografía y Catastro para Costa Rica.

owenwengerd

You didn't say whether this is a single-selection or multiple-selection style listbox. Are you perhaps looking for (dcl-ListBox-SetCurSel)?

Fred Tomke

Hi, the right function depends on the listbox selection type. Use SetCurSel in SingleSelection ListBox, SelectItem in MultiSelection typed listboxes.
Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]