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. textbox to loop?

textbox to loop?

Scheduled Pinned Locked Moved Visual Basic
questioncsstutorial
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.
  • M Offline
    M Offline
    Makniteasy
    wrote on last edited by
    #1

    I have a loop for a datagrid that shows all the amount rows added together in the caption.text of the datagrid. now i am going to change the loop because i dont need to add the rows, i need to subtract them. i know how to do that, but my question is that i have a textbox(textbox6) for which the user will need to enter a balance to show in the caption.text before the loop can subtract anything. any tips will be greatly appreciated. this is what i have. Dim t6 As Object t6 = TextBox6.Text For Each t As String In TextBox6.Text Amount += t Next Me.DataGrid1.CaptionText = "Current balance $" & t6.ToString() it is acting wierd. if i input 7 in the textbox then the data grid recieves only an addition of 1. if i input 9 it gets an addition of 4.why Makniteasy

    R 1 Reply Last reply
    0
    • M Makniteasy

      I have a loop for a datagrid that shows all the amount rows added together in the caption.text of the datagrid. now i am going to change the loop because i dont need to add the rows, i need to subtract them. i know how to do that, but my question is that i have a textbox(textbox6) for which the user will need to enter a balance to show in the caption.text before the loop can subtract anything. any tips will be greatly appreciated. this is what i have. Dim t6 As Object t6 = TextBox6.Text For Each t As String In TextBox6.Text Amount += t Next Me.DataGrid1.CaptionText = "Current balance $" & t6.ToString() it is acting wierd. if i input 7 in the textbox then the data grid recieves only an addition of 1. if i input 9 it gets an addition of 4.why Makniteasy

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Sorry, but I dont get what you are trying to do... You assign the Text of the textbox to the object variable t6 and print it out at the end. But in the loop you are only adding (I thought you want to substract something) values to the variable Amount. And what is For Each t As String In TextBox6.Text supposed to do in your opinion? I dont think thats what you are really trying to perform...

      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