Identifying controls

falled

Member
Joined
Sep 16, 2006
Messages
20
Programming Experience
Beginner
Hi people,

I know I can find specified controls making afor loop and searching by the name

For x=0 to Y step 1
...
next

There's any way to find it with a unic instruccion? something about hash?

Thank you all and sorry for my bar writting

Visca el Barça i
Visca Catalunya

FCBarelona 3-Reial Societat 0
 
Maybe you can use this:
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] matches() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Control = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Controls.Find(name, TrueFalse)
[/SIZE]
 
Well correct me if i'm wrong,

This code will return me an array of all the controls of the Form witch name is like the parameter???

Sorry for my bad writting
 
That's right - so if you only had one instance of the control with name , you'd reference it with matches(0) ... you can also test whether you get any matches with the length property.

VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] matches() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Control = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Controls.Find(name, TrueFalse)
If matches.Length >0 Then
   ...
End If

[/SIZE]

Is that not what you're after?
 
Back
Top