PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WEBDEV 2024 → how to loop through all controls in a page
how to loop through all controls in a page
Iniciado por vvido, mar., 05 2019 8:38 AM - 3 respostas
Membro registado
94 mensagems
Publicado em março, 05 2019 - 8:38 AM
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
Membro registado
28 mensagems
Popularité : +2 (2 votes)
Publicado em março, 06 2019 - 3:05 PM
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
Membro registado
94 mensagems
Publicado em março, 06 2019 - 4:41 PM
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
Membro registado
28 mensagems
Popularité : +2 (2 votes)
Publicado em março, 07 2019 - 11:06 AM
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