author=roy_043 link=topic=2317.msg11659#msg11659 date=1444062585 wrote:
In your first post when you say 'design mode', which I have interpreted as 'design time', you in fact mean 'at run time'.
It is an interesting problem and I think your solution is pretty clever, but I don't know a better one. I have checked dcl-Control-GetProperties and dcl-Control-Dump but they do not provide useful hidden information.
When you have talked at runtime.
Use the hidden grid was the best I have found.
Thanks Roy
(defun c:test_form_OnInitialize (/ JoyWidth)
;;;Calculating the width of the Label control
(setq JoyWidth (dcl-grid-calccolumnwidth test/form/Grid1 strText)) ;_ visible = false
;;; Apply the width of the form
(dcl-control-setwidth test/form (+ JoyWidth 8))
;;; Apply the width in Label control
(dcl-control-setwidth proj/form/label JoyWidth)
;;;
(dcl-control-setcaption test/form/label strText)
) ;_ fim de defun