"Wrong" parent for TextBox controls in composite control

J

Jonas

Hi!

I have built two very similar composite controls that consists of a number
of textboxes each.
In the PreRender-event I have the following code which I use to dynamically
set the TabIndex on the textboxes so that they get right in the flow of the
parent page.

Dim ctl As Control
For Each ctl In CType(sender, cmPerson).Controls
If TypeOf ctl Is TextBox Then
CType(ctl, TextBox).TabIndex += _tabIndexControl
End If
Next

One of my composite controls works just fine, when the parent page loads, I
set the _tabIndexControl value via a property and the code above is
executed. But on my other control, which has the same code, just different
textboxes and layout, the code do not find the textboxes in the Controls
collection.

Any tips?

TIA

Jonas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top