create control array in vb.net

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Dear All :

How to create control array class in vb.net
and how to use loop method so that add all button of cuurent form into
collection class

Thanks
 
Tom,

All child controls are in the collection from its parent. Therefore often
there is no need to create that array.

When you want by instance all buttons that are directly on your form than
you can do

\\\\
for each ctr as control in me.controls
if Typeof ctr Is Button then
'do something
end it
Next
///

I hope this helps,

Cor
 

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

Back
Top