How to...
looping in sstatb(2) and retrive the type and name of each controll
In my case i have only label, tbox and combobox
looping in sstatb(2) and retrive the name of each controll
-
- PlatinumLounger
- Posts: 4576
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 80088
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: looping in sstatb(2) and retrive the name of each controll
Does this work?
Code: Select all
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Container Is Me.SSTab2 Then
Debug.Print TypeName(ctl), ctl.Name
End If
Next ctl
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4576
- Joined: 26 Apr 2010, 17:36
Re: looping in sstatb(2) and retrive the name of each controll
Sorry....HansV wrote: ↑24 Dec 2024, 14:03Does this work?
Code: Select all
Dim ctl As Control For Each ctl In Me.Controls If ctl.Container Is Me.SSTab2 Then Debug.Print TypeName(ctl), ctl.Name End If Next ctl
i need to loop only the second tab o Sstab
-
- Administrator
- Posts: 80088
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: looping in sstatb(2) and retrive the name of each controll
Again untested:
Code: Select all
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Container Is Me.SSTab2 Then
If ctl.Container.Tab = 1 Then ' tabs are zero-based
Debug.Print TypeName(ctl), ctl.Name
End If
End If
Next ctl
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4576
- Joined: 26 Apr 2010, 17:36
Re: looping in sstatb(2) and retrive the name of each controll
I'll clarify...HansV wrote: ↑24 Dec 2024, 15:11Again untested:
Code: Select all
Dim ctl As Control For Each ctl In Me.Controls If ctl.Container Is Me.SSTab2 Then If ctl.Container.Tab = 1 Then ' tabs are zero-based Debug.Print TypeName(ctl), ctl.Name End If End If Next ctl
in my project have a Sstab with 5 panel
I need to loop element of the second panel (number 1 in this case, you suggestion)
-
- Administrator
- Posts: 80088
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: looping in sstatb(2) and retrive the name of each controll
I don't have VB6 so I cannot help you.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4576
- Joined: 26 Apr 2010, 17:36