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