How useful is the Focus documentation (WindowAt) is?

Here’s the entry:

  1. I have a standard DesktopWindow,
  2. What will I do with a string (.Name in the example).

I only wanted a Reference to the Control with the Focus in the DesktopWindow’ front window.

In short: I was awaiting when asking for Focus to get the reference to the Control who have the Focus then I can ask for its .Name, etc.; instead I get a UI something Control.

Some help is welcome.

As the docs say, Focus returns a DesktopUIControl — Xojo documentation

That is the super class for the controls on your window.

You can see from that page what properties and methods can be accessed from the superclass.

You write something like

If focus = FirstNameField then

Where you compare the object you get to a known one.