Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to use control collection

How to use control collection

Scheduled Pinned Locked Moved Visual Basic
tutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rmesh
    wrote on last edited by
    #1

    I would like to use control collection Method to clear the values of text box through one code is it possible

    J J 2 Replies Last reply
    0
    • R Rmesh

      I would like to use control collection Method to clear the values of text box through one code is it possible

      J Offline
      J Offline
      Johan Hakkesteegt
      wrote on last edited by
      #2

      Hi, See if you can adapt this piece of code to your needs: Private Function ButtonLock(ByVal key As Boolean) Try Dim Ctrl As Control For Each Ctrl In Controls If TypeOf Ctrl Is Button Or TypeOf Ctrl Is ComboBox Then Ctrl.Enabled = key End If Next Catch Ex As Exception msgbox(Ex.message) End Try End Function Hope it helps, Johan

      R 1 Reply Last reply
      0
      • R Rmesh

        I would like to use control collection Method to clear the values of text box through one code is it possible

        J Offline
        J Offline
        jsampsonPC
        wrote on last edited by
        #3

        If you have a collection of TextBoxes you can do this

        For Each tb As TextBox In CollectionName
           tb.Text = Nothing
        Next
        

        Jonathan Sampson www.SampsonResume.com

        1 Reply Last reply
        0
        • J Johan Hakkesteegt

          Hi, See if you can adapt this piece of code to your needs: Private Function ButtonLock(ByVal key As Boolean) Try Dim Ctrl As Control For Each Ctrl In Controls If TypeOf Ctrl Is Button Or TypeOf Ctrl Is ComboBox Then Ctrl.Enabled = key End If Next Catch Ex As Exception msgbox(Ex.message) End Try End Function Hope it helps, Johan

          R Offline
          R Offline
          Rmesh
          wrote on last edited by
          #4

          in my project the form background color was not changed i have write the code to change the back color at run time but that code will not working what i have to do?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups