Display Line Numbers In RichTextBox?
Nov 9, 2009Ist : How to Get Current Position of Text in RichTextBox Also The Line Number?
2nd : How to Display Line Numbers In RichTextBox?
Ist : How to Get Current Position of Text in RichTextBox Also The Line Number?
2nd : How to Display Line Numbers In RichTextBox?
How to Add numbers in the margin for Line numbers Picture Provied As a example
View 3 RepliesI have a list of strings in my richtextbox. I need a code to check if there are numbers in the first line, if there is then proceed with the rest of my code, else delete first line.
View 2 RepliesI need some kind of code to check if the first line in a richtextbox contains numbers or not.
Something like this:
If Richtextbot1.Lines(0) contains Numbers Then
Goto startbot
Else
[Code].....
If the first line contains 4 or more numbers, it will use it. After each loop it will delete line 1. So it repeats for the next line. When my code reaches the 3rd line, and it doesnt find 4 or more numbers it needs to delete the line.
Im currently using this:
[code]...
How do I get the current line and column numbers in a RichTextBox in a Winforms application?
View 3 Replieslet's see how fast I get an answer for this, ... I am still searching the menus in the mean time
View 2 Replieswhat i need to do is open a txt file, read line by line, decode each line into an array and display. Now all works ok apart from one line.
sTextLine = objReader.ReadLine() <-- Value of string cannot be converted.
full code here
-------------
Dim objReader As New System.IO.StreamReader(sOpenFile.Text)
Dim sTextLine As New ArrayList()
Dim sText As String = ""
Dim i As Integer = 0
[code]....
The following code selects a line ina richtextbox. It works OK expect from one problem:
When a line is biger than the size of the richtextbox, it wraps it. This create a big problem as I can not select the last line of the richtextbox (when a line is wrapped it becomes two lines). When I set wordwrap to off it works just fine
Private Sub RichTextBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles RichTextBox1.MouseMove
RichTextBox1.Focus()
[CODE]...
I want to loop the lines of my RTB and add a vbTab on each line.How do i do this?
View 1 RepliesTo read any form's text (except RichTextBox) line by line I've always used this splitting
Dim Lines() as String = Split(TextBox1.Text, vbNewLine)MsgBox(Lines(0))This code just works perfectly.But whenever I try this code on a RichTextBox like this:Dim Lines() as String = Split(RichTextBox1.Text, vbNewLine)MsgBox(Lines(0))The message box appears with the whole lines.I think maybe the RichTextBox1.Text() returns another new line character (means not vbNewLine).
I am working on an assignment that will display the forst 10 fibonacci numbers in sequence. However when my results are displayed, the numbers are all stacked on top of each other like this: 011235813213455. I have tried to play with it but i can't seem to get my numbeers to space out or even maybe have a comma "," betweeen each number.[code]
View 2 RepliesI'm using VB08. I've populated a listbox with numbers and I want to add all those numbers together and display the result in a Label. I've heard about using parse but I don't understand exactly how it works.
This is the code that I have that i think should work.
Dim lblTotal As Decimal
Dim sum As Double
For Each decAdded As Decimal In Me.lstRunningTotal.Items
sum += Double.Parse(decAdded)
Next
lblTotal = FormatCurrency(sum)
When I run it, nothing happens. My "For Each" statement I'm not sure if it's doing what I think it's doing. I can't believe I spent 6 hours banging my head against the wall but I finally got it figured out.
This is my revised code:
Dim sum As Decimal
For Each decAdded As Decimal In Me.lstRunningTotal.Items
sum += Decimal.Parse(decAdded)
Next
lbl_Total.Text = sum
Just some suttle changes made the difference
I am trying to implement line by line scrolling on my richtextbox - Here is the initial code which I think is incomplete and doesnt work.I have VB 2010 Express?
Class RichTextBox1
Inherits RichTextBox
Private Const WM_SCROLL As Short = &H20A
[code]....
how to delete a richtextbox line, if the line only has one value. Ex:
[Code]...
i have 2 richtextbox,which will be compared with each other;array by array. if those array are same with each other;array1(3)=array2(3); then i will just display "*********" in another RTB3.but then if there are any differents between array1 and array 2, i will display error and state at which line does the errors occur.Next,i will highlight the error line in RTB1.and here is my problem.
i knew that i should use command below to complete the pogramme,but the part selection start,i dont know how to full fill it:
Richtextbox1.selectionstart =XXXXXXXXXXX
richtextbox1.selectionlength = array1(i).length
richtextbox1.selectionColor = Color.YellowGreen
i'm trying to create a rogramme that will compare the arrays between richtextbox1 and richtextbox2. if there is any error(s),then i will highlight the current array line in the richtextbox1. e.g.,if array1(7) <> array2(7) then i will highlight only array1(7) which is in the richtextbox1.how can i do this...? I know already that i should use command beloow to settle the problem but
View 1 RepliesI need help with reading a RichTextBox line by line I have this code:
For i As Integer = 0 To RichTextBox1.Lines.Length - 1
Label14.Text = (RichTextBox1.Lines(i))
Next
But can't get it to work It just skips to the last line
How to copy RichTextBox to an array line-by-line and back to another RTB From that array?
View 2 RepliesI know how to read comma delimited from a file but I do not know how to read these vales from a richtextbox.
View 1 RepliesI need my app to enter each line of a richtextbox for a different field in my webpage.Currently what im thinking is:
Get string of first line in RichTextBox
Enter string into webpage
Delete first line in RichTextBox
loop
how to create a list in a richtextbox, with every new item in a new line... just like:
1
2
3
etc.
I tried it like that:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer
[Code].....
I just created 5 Rich text boxes in runtime through a subroutine as:
Dim c As Control
c = New RichTextBox()
With c
[code].....
How to add text to new line in a RichTextBox?
View 2 RepliesHow do i change a line in a richtextbox?[code]...
View 4 RepliesI've been search and I can't found an answer that works, I need to remove (delete) the last line in a RichTextBox1 in vb .net, I mean remove last line and 'breakline' too, but only the last, no others,
View 1 RepliesHow do I get all the text in a string of a text line in a RichTextBox?
View 2 RepliesI know it seems like a simple enough question, but I can't figure out how to get and set the current line of text. Say line 4 is "Hello World", I want to be able to recieve that this says "Hello World" then switch it with something else if need be.
View 4 RepliesHow do I retrieve the text from each line of a RichTextBox So if the user enters:
Random 1
Random 2
Random 3
How could I get each line, returning 'Random 1', 'Random 2', and 'Random 3'?
I wonder is there any way to highlight a line in a richtextbox once the user hovers the cursor over it and get its value? I am also looking for a way to define the colour of the selection (e.g., blue, balck, etc)
View 2 Replies