|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Collection TypeSimple Question. Why this simple code will not compile?
Dim obj As Object For Each obj In GroupBox1 Next Hi,
You need to reference the Controls property of the GroupBox1 object: --- For Each obj In GroupBox1.Controls ' etc... Next --- Regards, -Adam. Daniel wrote: Show quoteHide quote > Simple Question. Why this simple code will not compile? > Dim obj As Object > > For Each obj In GroupBox1 > > > > Next > > Daniel,
Because that you for a foreach needs to go through a collection(ilist icollection) A groupbox exist from individual properties, methods and events, however those are not direct in a collection. Cor "Daniel" <d_shl***@hotmail.com> schrieb: Try this instead:> Simple Question. Why this simple code will not compile? > Dim obj As Object > > For Each obj In GroupBox1 \\\ For Each ctr As Control In Me.GroupBox1.Controls ... Next ctr /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thanks, for your response.
I was looking, for some reason, for something like GroupBox1.Objects instead of Controls :( Thanks a lot.
Help with Debugging
Paging by example - help - still no luck.... Get processes list problem (win 2000) BindingManagerBase Problem Hide members in a derived class Reading an XML file into a Dataset - problem Custom Collections : overriding toString Response.Redirect("WebForm1.aspx") Sharing references/members VB.net Ablauf vom packen eines Projekts |
|||||||||||||||||||||||