problem related to textbox
-
hello everyone i am having 2 textboxes now i display '0' values in both textboxes at design time at run time i change the values of it like textbox1 has value 3 now i want that textbox2 should start from 1 when i enter any numeric value in textbox 1 for this example if i enter 3 in textbox1 then textbox2 should be 1 and inrement likewise. for that my code is:
If Val(Me.txtbox1.text) > Val(Me.txtbox2.Text) > 0 Then
Me.txtbox2.Text = Val(Me.txtbox2.Text) + 1
Else
Me.txtbox2.Text = Val(Me.txtbox2.Text) - 1
End Ifbut this is not working please suggest some another code thank you all. :) :)
-
hello everyone i am having 2 textboxes now i display '0' values in both textboxes at design time at run time i change the values of it like textbox1 has value 3 now i want that textbox2 should start from 1 when i enter any numeric value in textbox 1 for this example if i enter 3 in textbox1 then textbox2 should be 1 and inrement likewise. for that my code is:
If Val(Me.txtbox1.text) > Val(Me.txtbox2.Text) > 0 Then
Me.txtbox2.Text = Val(Me.txtbox2.Text) + 1
Else
Me.txtbox2.Text = Val(Me.txtbox2.Text) - 1
End Ifbut this is not working please suggest some another code thank you all. :) :)
-
It seems like a pretty straight-forward question, but still I don't understand what needs to be done. Please explain it again so I might understand what you're trying to do ;) Cheers, Zaegra
Motivation is the key to software development.
suppose there are two textboxes and button1 in form textbox1- for no of documents textbox2-is counter now when i type '3' in textbox1 then this count which is another textbox2 should auto generate from '1' now when i click on button1 then this count should have value '2' and all textboxes becomes clear i.e there should be 2 in textbox2 now when i again click on button1 then this count which is textbox2 should have value '3'and all textboxes become clear.. please suggest some code for it hope you got me... please help... :) :)
-
suppose there are two textboxes and button1 in form textbox1- for no of documents textbox2-is counter now when i type '3' in textbox1 then this count which is another textbox2 should auto generate from '1' now when i click on button1 then this count should have value '2' and all textboxes becomes clear i.e there should be 2 in textbox2 now when i again click on button1 then this count which is textbox2 should have value '3'and all textboxes become clear.. please suggest some code for it hope you got me... please help... :) :)
suppose there are two textboxes and button1 in form textbox1- for no of documents textbox2-is counter now when i type '3' in textbox1 then this count which is another textbox2 should auto generate from '1' now when i click on button1 then this count should have value '2' and all textboxes becomes clear i.e there should be 2 in textbox2 now when i again click on button1 then this count which is textbox2 should have value '3'and all textboxes become clear.. please suggest some code for it hope you got me... please help.
-
suppose there are two textboxes and button1 in form textbox1- for no of documents textbox2-is counter now when i type '3' in textbox1 then this count which is another textbox2 should auto generate from '1' now when i click on button1 then this count should have value '2' and all textboxes becomes clear i.e there should be 2 in textbox2 now when i again click on button1 then this count which is textbox2 should have value '3'and all textboxes become clear.. please suggest some code for it hope you got me... please help... :) :)
So you mean each time the button is clicked the value of TextBox2 needs to be increased by one? Here you go: (NOTE: Make sure the user only inserts a numeric value in TextBox1, if not, an exception will appear. Also, in the Designer set the Text Property of TextBox2 to "1")
Private Sub Button1_Click(..) Handles Button1.Click
Dim dec as Decimal = TextBox2.Text
dec+=1
TextBox2.Text = dec
End SubMotivation is the key to software development.
modified on Saturday, May 9, 2009 10:43 AM