forms_getcontrols

Started by johnM, August 15, 2011, 03:00:28 AM

Previous topic - Next topic

johnM

I’m using  forms_getcontrols to save user data to a file then using it again to read the file and repopulated the dialog. So far I have 206 items. It works great but my question is: Will it always return the controls in the same order? (I know adding or deleting a control will change it)
Will changing the tab order change the order it get the controls?
I’m still testing but so far so good.

I used the forms_getcontrols  function to check the all the important controls to see if they all had data and if not, it would set the back color to red and alert the user to check all inputs. It works great

Fred Tomke

Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

johnM

Will it always return the controls in the same order?
how is the odrer selected?

Fred Tomke

Hi, as far as I remember it depends on the order in the z/tab-order-pane.

Regards,
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

johnM

I am still testing it but I thought it would be worth posting in case anyone else wanted to check it out.
Just to clarify I have a modal form with a tab strip with 12 tabs.
When I change the tab order on a tab the form_getcontrols returns different.
But from what I can tell so far on the tab strip it returns controls on the first tab that was created.
From the time I started the form till now I have moved controls and added and deleted tabs and also rearranged the tab order, so I cannot be certain of the exact steps that I have taken untill now.
I was just wondering if anyone could explain how the order of tab strip controls are retrieved.
My guess is: the first tab created (not always the first in the index order) then the controls on that tab in the Z-tab order then the next tab created and so on.
can anyone conferm this or correct me if it is wrong.
Thanks for any help.

owenwengerd

I think you are correct in your assumptions.  In any case, there is no guarantee that the implementation of form_getcontrols won't change in the future, so to be safe you should write code that works correctly no matter which order the controls are returned.
Owen Wengerd (Outside The Box) / ManuSoft

johnM

Owen,
I totally agree. It’s good for globally changing certain properties but as far as collecting a particular group of data the old fashion way is better because it will be easier to update the project in the future.
At least I have a better understanding of how things flow.
Thanks to all for the feedback.