1 Replies - 489 Views - Last Post: 27 June 2012 - 08:41 AM Rate Topic: -----

#1 CJT179  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-June 12

How to Keep Text in Textbox the Same While Changing an Integer Value

Posted 27 June 2012 - 08:33 AM

I am new to Visual Basic 2010, but I have been trying to make a line reader with an imported text document into a RichTextBox through an internet source.

I want the RichTextBox's line zero (the first line) to really be line one, but without changing the text in the TextBox to show the change. In other words, I want that change to happen in the background of the program.

I have tried...
  • taking the text from one TextBox and putting it into another, while subtracting an integer value of one
  • an attempt to use a timer to copy the text from one TextBox to another to read the line properly.


I have tried a couple of other things too, but most of them were much more complicated and I could not really explain what each thing did.


I could really use someone's help as I feel just about stuck at this point, and could really use some guidance as to where to go from there.


Again, I want line 0 to really be line 1, but not show a change in the TextBox to the user. I also do not want to delete or make invisible the ORIGINAL TextBox that the user entered the text in for the line reader.

How do I make line zero line one, without showing anything visible to the user, and only hiding what is going on (in terms of converting the line number from zero to one) in the background of the program?


Thanks, and I really appreciate whatever help that I can get. :)

mod: snip - removed quote of original post

Sorry, I am new to the forum as well, and did not mean to put the "code" tags around my question.

My apologies!

This post has been edited by modi123_1: 27 June 2012 - 08:41 AM
Reason for edit:: fixed botched code tags


Is This A Good Question/Topic? 0
  • +

Replies To: How to Keep Text in Textbox the Same While Changing an Integer Value

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5571
  • View blog
  • Posts: 11,910
  • Joined: 02-June 10

Re: How to Keep Text in Textbox the Same While Changing an Integer Value

Posted 27 June 2012 - 08:41 AM

EASY HACK: make the title (path) of the document the first line (line 0)
That makes the line numbered '1': The first line of the actual text document you read in.

This also gives your user some feedback if you turn this into a multi-tabbed program with several documents at once.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1