XOJO 2021r1.1 - Windows 11
Is it possible to itterate trought all the controls contained in a TabPanel ?
In a Window I have found the solution, but I would like to do the same thing for a TabPanel.
Regards
Etienne
XOJO 2021r1.1 - Windows 11
Is it possible to itterate trought all the controls contained in a TabPanel ?
In a Window I have found the solution, but I would like to do the same thing for a TabPanel.
Regards
Etienne
Yes, using Window — Xojo documentation, Window — Xojo documentation, Window — Xojo documentation and the example code under Controls:
For Each c As Control In Self.Controls
If c IsA TextField Then
TextField(c).Enabled = False
End If
Next
Change TextField
to TabPanel
in the ISA
line and add your code in the if
block.
Of course, not tested with the current Xojo (but done long time ago).
Hi Emile,
Thanks for the reply, but it didn’t work.
Regards
Etienne
Iterate the controls on the window and check the control’s Parent being the TabPanel control.
You would also have to check it is the correct tab panel and the correct panel number. There is no way of doing it just for a given TabPanel. Only Windows and ContainerControls have a Controls iterator.
Here is the “solution” of the trouble. It tooks me 4 hours…
Just because I add a DesktopGroupBox in the window I choose to check that.
and in another window with DesktopListBox, DesktopButton and DesktopTabpanel:
OK, I removed the DesktopButton and same trouble.
My conclusion: Mission Impossible.
Desktop (controls) such as DesktopButton, DesktopCheckbox etc are API2 controls. Their superclass of DesktopControl.
API1 controls such as Button, Checkbox etc have a superclass of Control.
Control and DesktopControl do not share any any relationship other than Object.
I gave you a simple solution in the other thread. Change the c as Control
to c as Variant
and you can put anything you want in c
.
Apparently, I do not noticed that line. I will try.
No crash.
THANK YOU TIM.
Thanks everybody for the replies.
Regards
Etienne