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. problem related to textbox

problem related to textbox

Scheduled Pinned Locked Moved Visual Basic
designhelptutorial
5 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.
  • N Offline
    N Offline
    nazimghori
    wrote on last edited by
    #1

    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 If

    but this is not working please suggest some another code thank you all. :) :)

    Z 1 Reply Last reply
    0
    • N nazimghori

      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 If

      but this is not working please suggest some another code thank you all. :) :)

      Z Offline
      Z Offline
      Zaegra
      wrote on last edited by
      #2

      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.

      N 1 Reply Last reply
      0
      • Z Zaegra

        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.

        N Offline
        N Offline
        nazimghori
        wrote on last edited by
        #3

        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... :) :)

        N Z 2 Replies Last reply
        0
        • N nazimghori

          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... :) :)

          N Offline
          N Offline
          nazimghori
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • N nazimghori

            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... :) :)

            Z Offline
            Z Offline
            Zaegra
            wrote on last edited by
            #5

            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 Sub

            Motivation is the key to software development.

            modified on Saturday, May 9, 2009 10:43 AM

            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