Hi.
John is of course correct.
But there are ways to get a reference to existing objects in a window. Any window has an array named control[] which contains all objects the window contains. So if a window has: dw_1, dw_2 and dw_3 the contents of control will be:
- control[1] : dw_1
- control[3] : dw_2
- control[3] : dw_3
Now, this can help you do some things in a more dynamic mode. You can have a string, with a control name, and check to see if the control exists. If found, you may be able to do some actions to that control, depending on its type.
Here is an example of a window containing 4 datawindows, and 3 commandbuttons. Three first datawindows do have predefined data. The fourth one gets filled with the list of controls on the window (by pressing the "Get Controls" button).
I can then select any control I want from the fourth datawindow. If press the "Button Bold", it checks if the selected control is a command button. If this is the case it sets it to bold or unset it from bold. If I press the "Change DW Color" button, then if the selected control is a datawindow, it changes it's background color to red.
So, while there are limitations, there are some things you can do dynamically.
I attach a simple workspace with the above example in case you want to experiment.
Andreas.