PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → how to loop through all controls in a page
how to loop through all controls in a page
Débuté par vvido, 05 mar. 2019 08:38 - 3 réponses
Membre enregistré
94 messages
Posté le 05 mars 2019 - 08:38
I have a window with several controls. In some cases I need to disable all entry controls and combo boxes depending on the current data in runtime.

Instead of manually writing code for each one I would like to loop through and set the properties.
Something like

for fld = firstfield() to lastfield()
// set some properties for fld according to the type
end

thanks
Membre enregistré
28 messages
Popularité : +2 (2 votes)
Posté le 06 mars 2019 - 15:05
First of all, please use your manual.

But you can use EnumControl: https://doc.windev.com/…

But another tip, you can select a bunch of controls and 'link' them to a GROUP. Give the group a name link GRP_Main. After this you can do: GRP_Main..state = grayed (or GRP_Main..state = active)

Regards,
Joey Dieleman
Membre enregistré
94 messages
Posté le 06 mars 2019 - 16:41
Thanks for you for your kind suggestion about reading the manual.
I do it, but I have problems with frenglish (it is english, but often inconsistent or hard to interpret without french background).
And finding the right name of the function, sometimes it is just not intuitive. Or maybe it is just me...

To often I click on the help button in the designer, but do not get the answer or explanation for the properties of the control I am trying to configure.
Complex controls are typical example of this non-documentation (table control for example).
I assume that the french version of the documentation is better.

EnumControl is I was looking for, thanks.
The group control only partly solves my problem, because I need more detailed access to controls (controls in different partly overlapping groups).
But it could be done this way too.

Thank you for your time
Membre enregistré
28 messages
Popularité : +2 (2 votes)
Posté le 07 mars 2019 - 11:06
Hi,

99% of all functions I found in the help, but I must admit it's not always that easy, it is time consuming. I whish there was more support of PCSoft (more examples, tutuorials etc) in english. This is why I try to answer some questions now and than. If more people would do that in the community this would make a big difference.

Regards,
Joey