4 Replies - 496 Views - Last Post: 17 October 2015 - 01:43 AM Rate Topic: -----

#1 art1976   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 10-October 15

How to display only 6 output characters in the text box

Posted 16 October 2015 - 11:11 PM

HI,

I would like to know how to make only 6 characters from the left will be print out on a text box?

For example, if my TextBox1.Text="2.0342.0344" , how to display only 6 characters from left which is 2.0344 into another text box?
Is This A Good Question/Topic? 0
  • +

Replies To: How to display only 6 output characters in the text box

#2 horace   User is offline

  • D.I.C Lover
  • member icon

Reputation: 768
  • View blog
  • Posts: 3,832
  • Joined: 25-October 06

Re: How to display only 6 output characters in the text box

Posted 16 October 2015 - 11:24 PM

could you use the String.Substring method to extract the first 6 characters of the String in TextBox1
https://msdn.microso...=vs.110%29.aspx
Was This Post Helpful? 0
  • +
  • -

#3 Minimalist   User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 241
  • Joined: 13-November 13

Re: How to display only 6 output characters in the text box

Posted 16 October 2015 - 11:54 PM

 Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        Dim str As String = TextBox1.Text
        TextBox2.Text = str.Substring(str.Length - 6)
    End Sub

Was This Post Helpful? 1
  • +
  • -

#4 art1976   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 10-October 15

Re: How to display only 6 output characters in the text box

Posted 17 October 2015 - 01:02 AM

Dear Minimalist,

It works. Thank you very much...
Was This Post Helpful? 0
  • +
  • -

#5 art1976   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 10-October 15

Re: How to display only 6 output characters in the text box

Posted 17 October 2015 - 01:43 AM

Dear Minimalist,

It works. Thank you very much...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1