Counting controls 
Author Message
 Counting controls

This code works fine in VB 6, but not in eVB.

1    Dim Ctrl As Control
2    For Each Ctrl In Controls
3        MsgBox Ctrl.Name
4    Next Ctrl

Error message is: Object doesn't support this property or method. Error
occurs on line 2.

Any ideas?
Thanx

Andrej



Mon, 07 Feb 2005 17:46:54 GMT  
 Counting controls
The Controls collection on the form doesn't support iteration.  Use a
for...next with Form1.Control.Count - 1 as the upper bound.

--
Chris Tacke, eMVP
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Quote:
> This code works fine in VB 6, but not in eVB.

> 1    Dim Ctrl As Control
> 2    For Each Ctrl In Controls
> 3        MsgBox Ctrl.Name
> 4    Next Ctrl

> Error message is: Object doesn't support this property or method. Error
> occurs on line 2.

> Any ideas?
> Thanx

> Andrej



Mon, 07 Feb 2005 22:02:13 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. User Count Control...

2. A Different Count between ListParagraphs.Count and the sum of Lists(index).ListParagraphs.Count

3. ListView Column Count / Subitem Count?

4. Adding a record count to the datagrid control

5. MasterVolume Control and bpm count

6. Displaying incoming byte count with winsock control?

7. Control Arrays and Count

8. ActiveX Control.Count bug, or wierd behavior

9. Counting members of a control array

10. Slider Control - make it count in reverse - possible?

11. Help in counting rows in DBGrid control

12. Data control returning wrong count

 

 
Powered by phpBB® Forum Software