PC Review


Reply
Thread Tools Rate Thread

Collection of controls

 
 
Bernard Bourée
Guest
Posts: n/a
 
      17th Oct 2004
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
(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      17th Oct 2004
"Bernard Bourée" <(E-Mail Removed)> schrieb:
> 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>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 
Reply With Quote
 
Bernard Bourée
Guest
Posts: n/a
 
      17th Oct 2004
Thanks a lot !

--
Bernard Bourée
(E-Mail Removed)
"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> a écrit dans le
message de news:(E-Mail Removed)...
> "Bernard Bourée" <(E-Mail Removed)> schrieb:
> > 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>
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Øyvind Isaksen Microsoft Dot NET 1 18th May 2007 10:24 AM
getting controls from the placeholder controls collection msnews.microsoft.com Microsoft ASP .NET 1 26th Sep 2004 12:19 AM
Adding controls to Page.Controls collection Jeremy Ames Microsoft ASP .NET 5 5th Mar 2004 08:33 PM
Adding controls to Page.Controls collection Jeremy Ames Microsoft C# .NET 0 3rd Mar 2004 04:53 PM
How to step through the controls in a webform controls collection Dave Adler Microsoft VB .NET 1 17th Feb 2004 11:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.