Collection of controls

  • Thread starter Thread starter Bernard Bourée
  • Start date Start date
B

Bernard Bourée

I want to create by code (runtime) a collection of ListView and to be able
to have acces to their properties.

Dim lwEntSor As New System.Windows.Forms.ListView()

Me.Controls.Add(lwEntSor)

Me.lwEntSor(viIdxCtl).TabIndex = viIdxCtl

The last line give me an error : lwEntSor is not a member of frmMain



How should I handle it ?
 
Bernard Bourée said:
I want to create by code (runtime) a collection of ListView and to be able
to have acces to their properties.

Dim lwEntSor As New System.Windows.Forms.ListView()

Me.Controls.Add(lwEntSor)

Me.lwEntSor(viIdxCtl).TabIndex = viIdxCtl

The last line give me an error : lwEntSor is not a member of frmMain

Accessing controls by their names or indices
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=controlbynameindex>
 

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