Exchange Forum > Dcl Dialogs
Height attribute for list_box tiles
Height attribute for list_box tiles

#1

Trevor
Join Date:
07-29-2007
I always have trouble figuring out the height for list_box tiles. It takes too long to get it to show a certain number of lines. And then sometimes nothing seems to work.
Height attribute for list_box tiles

#2

J Moreno
Join Date:
07-30-2007
I've always heard just add one to the desired number of lines. When that doesn't work, just add one more.
Height attribute for list_box tiles

#3

Viper
Join Date:
07-31-2007
Here's a short function with an algorithm to calculate the list_box height values.
It rounds up the lines that are skipped in dcl. i.e. 5 10 15 21 26 31 37 42 47 and 53...
I hope this works for you.
Code:
(defun c:LBH (/ Height Lines)
  (if (not (setq Lines (getint "\nNumber of list_box lines <1>: ")))
    (setq Lines 1)
  )
  (setq Height (+ (* (fix (- (1+ Lines) (* Lines 0.18751))) (/ 16 13.0)) 0.12))
  (princ (strcat "\nThe list_box height attribute value = " (rtos Height 2 2)))
  (princ)
)