Private Scope for UI Controls?

I feel I have a decent grasp of scoping in Xojo Desktop, for Modules, Classes, Objects and such, when it comes to Public, Protected & Private and so on.

But a question sometimes will pop into my head when I drag new UI Controls (e.g., Labels, TextFields, etc) from the Xojo IDE Library on to a new Desktop Window of a project. By default, these UI Controls are automatically assigned Public scope.

But let’s say that my project has no need for code logic from one Window to interact directly with the UI Controls of another Window (any data will be exchanged via Public Properties or Shared Methods). With this in mind - is it okay to set the scope of the UI Controls of my Windows to Private?

In general, is the Public default for UI Controls just to make things easier as a starting point in Xojo projects?

And are there any down-sides or benefits to setting UI Controls to Private?

A quick project test shows no obvious issues, but maybe my projects so far haven’t reached an advanced enough stage to learn any hard lessons yet…

I hope my question makes sense. Thank you for any feedback or insight.

I’d argue they should ALWAYS be private
Otherwise you have the urge and ability to, from outside something like a container control that has controls embedded in it, to just reach inside and alter things which is a Bad Habit™

Thank you Norm, this confirms what I was thinking too.

At the very least I’ll call this a “best-practice” point to keep in mind.

Just chiming in here, I agree with Norman. I always set my UI controls to private. Always. I treat each window as its own mini program, with inputs and outputs. So keeping them private makes sure that rule doesn’t get violated.

Norman submitted a feature request: <https://xojo.com/issue/55803>

Aaaaaaall aboard!