Jump to content

Help with adding numbers to text box.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
xGhost4000x

xGhost4000x

    Newbie

  • Members
  • Pip
  • 6 posts
Hi, I have a button that adds the number one to a text box, now the problem is that if I press the button twice it gets rid of the first one and imputs the second.

CODE:
Private Sub one_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles one.Click

If cntrlr.Text = "Box 1" Then
txtDisplay.Text = "1"
Else
txtDisplay2.Text = "1"
End If


End Sub

Any help?

#2
DwgToolbox

DwgToolbox

    Newbie

  • Members
  • Pip
  • 4 posts
Try this:
txtDisplay.Text = txtDisplay.Text & vbCrLf & "1"

You will need to set the multiline value of the textbox to "true"

#3
xGhost4000x

xGhost4000x

    Newbie

  • Members
  • Pip
  • 6 posts
It worked! Thanks, for the help.

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Or, just:

txtDisplay.Text += vbCrLf & "1"

... no?
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums