DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    364

    Question Remove a dynamic control

    Good Afternoon All,

    I've created some comboboxes dynamically based upon how many items are in a listview. I'm trying to remove them when I press a button. Can anyone guide me to a resource that can help with this.

    Everything I try doesn't work, for example:

    Dim cbo As ComboBox = Nothing
    For x = 1 To ilvItems
    cbo.Name = "cbo" & lvApplications.Items(x).text
    Controls.Remove(cbo)
    Next x

    Dim matchedControls As Control() = Me.tpSetAccess.Controls.Find("cbo" & lvApplications.Items(x).Text, False)

    'Dim matchedControls As Control() = Me.Controls.Find("btn" & i.ToString(), False)

    For Each control As Control In matchedControls
    '// Only remove the buttons
    If TypeOf (control) Is ComboBox Then
    Me.Controls.Remove(control)
    End If
    Next
    Next

    Any ideas????


    Thanks...

    jb
    Last edited by jcb1269; 01-15-2010 at 01:17 PM.

  2. #2
    Join Date
    Jul 2004
    Posts
    364

    Talking I got it....

    Created all the controls in a panel and then just cleared the panel. Short and sweet.



    jb

Similar Threads

  1. Actipro Wizard 2.0 Released (Windows Forms Control)
    By Actipro Software Support in forum dotnet.announcements
    Replies: 0
    Last Post: 03-16-2003, 07:40 PM
  2. Actipro Wizard 1.03 .NET Control Released
    By Actipro Software Support in forum dotnet.announcements
    Replies: 0
    Last Post: 09-29-2002, 10:30 PM
  3. How long before the next version??
    By _CAG in forum .NET
    Replies: 146
    Last Post: 08-12-2002, 10:40 PM
  4. Re: App Object (fixes)
    By Rob Teixeira in forum .NET
    Replies: 129
    Last Post: 06-06-2002, 05:23 AM
  5. Question on Dynamic Control Creation
    By Shravan in forum VB Classic
    Replies: 0
    Last Post: 06-05-2002, 08:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links