PopUp Menu

In My Application i have use 2 Different window. In main window i have 16 labels. I want to adjust all the Label position using the Window2.
Hence i have created the Popup menu. But I don’t know how to list out all labels which was available in Window1.
Help me out…

You could create a ControlSet for the labels (see documentation, please). Otherwise, you can add all labels to the PopupMenu like this (put the code in the Open event of the PopupMenu):

[code] DIM i AS integer

IF Window1.ControlCount > 0 THEN
FOR i = 0 TO Window1.ControlCount-1
IF Window1.Control(i) ISA Label THEN
me.AddRow Window1.Control(i).Name
me.RowTag(me.ListCount-1) = Window1.Control(i)
END IF[/code]

The reference to the respective label is stored in the PopupMenu’s RowTag property for later usage…

If i create the controlset for all labels , how to list out all labels which was available in Window1 ?

Creating a control set is similar to creating an array (there are some very important differences however). Each item in the control set would get an index value.

So if you want to adjust the text property (or any other property) of the label you’d do like:

For i as integer = 0 to numberoflabels
      MyLabel(i).text = "This is label number "+str(i)