473,382 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

show next line of list in textbox2

I would like textbox2 to display the next line after I search the textbox.
Can someone advise ?
Expand|Select|Wrap|Line Numbers
  1.   Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  2.         Using reader As New StreamReader(pathto)
  3.             While Not reader.EndOfStream
  4.                 Dim line As String = reader.ReadLine()
  5.  
  6.                 If line.Contains("SearchString") Then
  7.                     TextBox1.Text = line
  8.  
  9.                     TextBox2.Text = "I want the next line to appear here"
  10.  
  11.                     Exit While
  12.                 End If
  13.             End While
  14.         End Using
  15.     End Sub
Nov 24 '13 #1
3 1084
Frinavale
9,735 Expert Mod 8TB
What is the "Next Line"?
Where is the "Next Line" located?
What does searching have to do with the "Next Line"?

-Frinny
Dec 2 '13 #2
I enter a sting to be searched for in a text file
After finding the line I entered, It is displayed in TextBox1.
I want whatever line comes next in the text file, displayed in textbox2
Say there are 4 lines in the text file
Line One
Line Two
Line Three
Line Four
and I search for "Line Two", it is displayed in texbox1 but I want "Line Three" to be displayed in textbox2
Dec 2 '13 #3
Frinavale
9,735 Expert Mod 8TB
Set a flag that indicates that you found the line.
If you have found the line loop one more time (if possible)


-Frinny
Dec 2 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: les_ander | last post by:
Hi, suppose I am reading lines from a file or stdin. I want to just "peek" in to the next line, and if it starts with a special character I want to break out of a for loop, other wise I want to...
3
by: rasdj | last post by:
I have a lot of SQL to convert to postgres from oracle. I have most of the problems worked out except for this last bit. Many of my tables need the last comma replaced with a close parenthesis -...
4
by: Matt | last post by:
Hi, Got an unordered list with 100% width, with 5 list items of 20% width styled to fill the width of the container element. Renders fine in Mozilla, but when you change the size of the window...
1
by: Rocketman | last post by:
I am trying to find out when i reach the next line when multiline is switched on and i DON'T PRESS ENTER TO GO TO THE NEXT LINE(lines method is there for that purpose). Is there any other method i...
6
by: Jacob Rael | last post by:
Hello, I have a simple script to parse a text file (a visual basic program) and convert key parts to tcl. Since I am only working on specific sections and I need it quick, I decided not to...
22
by: ashkaan57 | last post by:
Hi, I am trying to put text on left and right side of the page and used: <div> <span>blah blah</span> <span style="float:right">blah blah</span> </div> The 2nd text does go to the right but the...
4
by: Vernon Wenberg III | last post by:
I'm not really sure how readline() works. Is there a way to iterate through a file with multiple lines and then putting each line in a variable in a loop?
2
by: poolboi | last post by:
hi guys, i got the info say CLASS 1234 NAME DAN if i use the code below:
15
dlite922
by: dlite922 | last post by:
I'm back again, Intro: I've got a floating div (outerDIV) with fixed width that contains an image (IMG) and a div that contains a short text (innerDIV) Problem: In FF, the innerDIV is...
1
by: Beginnera | last post by:
I have never used php before however managed to install the script and setup the database tables for an open source script. So please excuse my lack of jargon. Currently a list of text ads that...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.