COMBO-BOX label not moving when I change COMBO-BOX:ROW

LBaliao

Member
Hello,

I appreciate everyone's help in advance. I have a combo-box that I change :ROW based on user setting. The combo-box moves to the correct :ROW but the label is left in its original position.

Thanks,
Liza
 

Osborne

Active Member
Something like this should work:
Code:
DEFINE VARIABLE vlabelHandle AS HANDLE NO-UNDO.

ASSIGN vlabelHandle = ComboBox:SIDE-LABEL-HANDLE
       vlabelHandle:ROW = 6.

If you also need to change the column setting as well look at the following solution:

A side-label is not part of a widget. It is a seperate widget itself, and widgets such as FILL-INs have a SIDE-LABEL-HANDLE attribute that associates a side-label widget with them. As they are seperate widgets they will need to be repositioned seperately as well.

The example below shows how to change the label dynamically, and how to reposition it in such a way that its new size and position is taken into account:
Code:
DEFINE VARIABLE hLabel AS HANDLE NO-UNDO.

ASSIGN hLabel     = MyFillIn:SIDE-LABEL-HANDLE
       MyFillIn:X = 150
       MyFillIn:Y = 150.

IF VALID-HANDLE(hLabel) THEN 
  ASSIGN hLabel:SCREEN-VALUE = "Testing:"
         hLabel:WIDTH-PIXELS = FONT-TABLE:GET-TEXT-WIDTH-PIXELS(hLabel:SCREEN-VALUE,hLabel:FONT)
         hLabel:Y = MyFillIn:Y
         hLabel:X = MyFillIn:X - hLabel:WIDTH-PIXELS - 4.
 
Top