Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Gurus*
Posted

I assume you're using the VB.NET Collection class. You should really try and use one of the .NET collection classes under System.Collections.

 

Anyway, since the VB.NET Collection class has no clear method it looks like you'll have to loop through it to clear it:

 

Do While myCollection.Count <> 0
 myCollection.Remove(0)
Loop

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

Ok, I STILL cannot get the stupid clear collection thing. Here is exactly what I need to do.

 

When the user clicks the ClearButton,

The InputTextBox should clear along with all of the display labels

The focus should return to the InputTextBox and

The ClearLabel should be disabled.

The Clear Routine must be written using collections and a For/Each loop.

To do this, create a collection of all display labels and use the loop to clear them.

 

 

None of the suggestions below (although appreciated) worked.

Posted

Sounds like someone has a homework assignment. ;)

 

Assuming I read your post right...

 

Dim l as Label
For Each l In YourLabelCollection
   l.Text = ""
Next

InputTextBox.Text = ""
InputTextBox.Focus()
ClearLabel.Enabled = False

Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...