By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,683 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,683 IT Pros & Developers. It's quick & easy.

looping into a collection

P: n/a
Is there an easy way to loop through all properties of a
textbox for example because I want to be sure a particular
custom property exists?

The same question applies to SQlDataAdapter and DataSet in
a form. Is there a way to get all datasets and
sqldataadapters in the form without writing

"me.sqldataadapter1..."
"me.dataset1..."

I'd prefer to lopp through a collection or something like
that.

Any suggestion?

Thanks.

Luc.

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Luc Trépanier <lu***********@etsmtl.ca> scripsit:
Is there an easy way to loop through all properties of a
textbox for example because I want to be sure a particular
custom property exists?


\\\
Imports System.Reflection
..
..
..
Dim pi() As PropertyInfo = Me.GetType().GetProperties()
Dim p As PropertyInfo
For Each p In pi
MsgBox(p.Name)
Next m
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
"Luc Trépanier" <lu***********@etsmtl.ca> schrieb
Is there an easy way to loop through all properties of a
textbox for example because I want to be sure a particular
custom property exists?

The same question applies to SQlDataAdapter and DataSet in
a form. Is there a way to get all datasets and
sqldataadapters in the form without writing

"me.sqldataadapter1..."
"me.dataset1..."

I'd prefer to lopp through a collection or something like
that.

Any suggestion?


Put them into an array/arraylist/collection once, later use a loop.
--
Armin

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.