Results 1 to 4 of 4

Thread: [RESOLVED] Removing controls

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    518

    Resolved [RESOLVED] Removing controls

    Hi,

    I'm using this code to remove controls from a panel...
    vb.net Code:
    1. For Each c As Control In Me.pnlDevices.Controls
    2.     Me.pnlDevices.Controls.Remove(c)
    3. Next
    ...but somehow it doesn't remove all the controls at once, I have to run the code 3 times to remove them all
    (there is about 20 to 30 of them, mainly labels)...

    I don't know if it matters, but the controls where added dynamically at startup...
    Last edited by Arve K.; Oct 6th, 2011 at 07:53 PM. Reason: typo + added some info
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width