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. Make into a loop?

Make into a loop?

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
2 Posts 2 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.
  • H Offline
    H Offline
    harveyhanson
    wrote on last edited by
    #1

    I have the follow code in VB.NET 2005, i am trying to make it into a loop, is it possible, and if so, anyone fancy having a go at helping me at doing it, hints...etc? The numbers of labels and text boxes goes from 1-10, so it will have to loop, then add 1 to the integer value, something like that!!! HELP! CODE: --- Priv Sub txtInput1_TextChanged(…) Handles txtInput1.TextChanged If txtInput1.Text.ToLower = lblLetter1.Text Then lblLetter1.ForeColor = R : intScoreAll += 1 Else lblLetter1.ForeColor = W End If lblLetter1.BorderStyle = BorderStyle.None : txtInput1.Enabled = False txtInput2.Enabled = True lblLetter2.BorderStyle = BorderStyle.FixedSingle txtInput2.Focus() End Sub ---

    C 1 Reply Last reply
    0
    • H harveyhanson

      I have the follow code in VB.NET 2005, i am trying to make it into a loop, is it possible, and if so, anyone fancy having a go at helping me at doing it, hints...etc? The numbers of labels and text boxes goes from 1-10, so it will have to loop, then add 1 to the integer value, something like that!!! HELP! CODE: --- Priv Sub txtInput1_TextChanged(…) Handles txtInput1.TextChanged If txtInput1.Text.ToLower = lblLetter1.Text Then lblLetter1.ForeColor = R : intScoreAll += 1 Else lblLetter1.ForeColor = W End If lblLetter1.BorderStyle = BorderStyle.None : txtInput1.Enabled = False txtInput2.Enabled = True lblLetter2.BorderStyle = BorderStyle.FixedSingle txtInput2.Focus() End Sub ---

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can use a foreach loop on the Controls collection and look for items by name or tag, or use dynamic type checking to work out which items are textboxes.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      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