Multiple windows

Hi, will be grateful for advice. I am just learning Xojo, which is generally very satisfying! I am creating an app which has two windows - a main window and another which will contain data I can later print. The second window contains blank labels (actually several as a control set). I want to set the label text property triggered by a push-button event on the main window. However, the compiler displays an “item doesn’t exist” error highlighting the label name in the second window (nmlabel(x).text). Is it possible to change a label/control property in a window from another window?

Yes, it’s possible. But you must write in window two for getting the controls of window one like this “Window1.ControlX” and vice versa in Window1. There you must write “Window2.ControlY”.

Thank you Michael. My problem must lie elsewhere. I had prefixed my statements exactly as you suggested, but the error message persists as before.

Hi Carl, can you post your code?

Deeply appreciate your time, however the problem has been resolved! My fault! It was a simple typo - I confused the letter l with number 1.
Sorry to be so much trouble.

Hahaha, a well known problem which happened to many of us too in the past. :smiley:
Another famous one is the zero and the O.
Try using an other font for coding in Xojo.
I’m using Source Code Pro
This front had a distinct difference between the 1 and the l.

There are probably many other suitable fonts.

using the xojo IDE autocomplete feature, it’s easy to see if some object/method/control exists or not as soon as you type it.
just press the TAB key.

I use Courier and AutoComplete. And I too sometimes type a wrong letter, sometimes a Copy/Paste stays as is (Copy / Paste is a Traitor !) and I forgot to change what have to be changed. This afternoon I was wondering while I get this data in that Column (ina DB). After looking at my code, I discovers that I correctlys tore the right data, but in the previous Column (two times !)…

Also, one (with money) can use a 4K monitor and the Couroer Font at 24 pixels (instead of 0)… :wink: