Stumped In Michigan

My project has multiple windows with text boxes and combo boxes for data entry and selection. Behind each control is code to accomplish what needs to be done. The events reference other controls on other windows and when this happens I get a referenced window opening. I have put code in every event to make the unwanted windows visible property false. This accomplishes what I need to do but the window flashes on each character entered in each input box. I have used VB for years and the referenced “forms” didn’t show up each time they were referenced, probably loaded in the back ground.

Is there a way to load the windows but not show them, and will this keep them from appearing when referenced?
The implicit instance property doesn’t appear to be what I need. I have thought about putting the information that will be referenced in a global variable so I don’t reference the other window controls directly, but that seems like the big hammer approach.

You could turn off implicit instantiation for each of your windows which would allow them not to show when you call them by name, but that doesn’t really address the issue of what’s wrong with this approach from a RB/Xojo perspective. YOu are asking your windows (forms in the VB world) to not only display your data, which they are good for, but also to be the repositories of your data, which they are not so good at. Better would be to find another way to hold the data you need to fill your controls on each of your windows. I would use a custom class (or classes) which are great at holding data. You could create a single global class referenced by each window, or have each screen hold its own instance of said class referencing it as needed. The structure of your data and your application will determine which approach is best.

Leave Implicit Instance on and toggle the Visible property in the Inspector to False/Off. Then when the window is referenced it gets implicitly instantiated but stays invisible.

I’d go for the ‘big hammer’ approach probably. Factor out a Model class from the window and instantiate that someplace relevant. Data access would be against that instance which gets passed around to where it needs to be, The window gets refactored to work off a reference that’s passed to it.

(beat me by 37 seconds)

Just a thought. If you are displaying or hiding windows based on what the user is doing would a Page Panel not be a better option? You could eliminate all your windows you used in VB and instead make each page on the Page Panel what was previously a window. In order to show the relevant window you could now do it in one line of code PagePanel1.Value = 0, 1, 2, etc…

Thanks for the good ideas. I am going to look at page panels to see where that leads me.