Can somebody give me a hint how to multiply each line in a richtextbox with a value?The richtextbox will have ex. 1000 lines with numbers, and I want to multiply all these lines with with a number.
I have a richtextbox, with random values in each line:
a1,a2,a3 b1,b2,b3 and so on.
This textbox stores the values in a jagged array after lostfocus. What i am trying to do, is for the user to have the ability to 'switch' values in each line if he wishes to do so. Each switched element becomes the first, and the first goes where the old value was. So it's basically a 'swap'. For example:Line1: a1,a2,a3 --> user highlights "a3", right clicks and a contextmenustrip appears with the option 'switch', once he clicks a3 goes where a1 was and a1 goes to a3. So the new Line1 would be: a3,a2,a1. After that if he switches a2, new Line1 would be: a2,a3,a1 Once the switch is done in the array, redisplaying the data in the RTB is not a prob.
I am working on a Programming notepad in VB.net, How would i add Line Numbers into a RichTextBox? An Example would be like in Notepade ++. Would i need to make a Class for it? I already have a class witch makes a richtextbox that when you type a word like "echo" it will change the color. Can i edit this to make the numbers? [code]
I have a richtextbox, and I want to highlight the lines in groups of ten, alternating colours every ten lines. I know I need to use:
Dim lineindex As Integer = Me.RichTextBox1.GetLineFromCharIndex(index) Dim first As Integer = Me.RichTextBox1.GetFirstCharIndexFromLine(lineindex) Me.RichTextBox1.Select(first, xxxx) Me.RichTextBox1.SelectionBackColor = Color.Red
However I'm not sure what to put in Select to get it to select the whole line, and I'm not sure how to get it to change colour every ten lines (to yellow)
I have a winform with richtextbox. I want to get the user input values in any window like chat programs(msn,yahoo,gtalk), Ms Word,...etc, and set the values into richtextbox?
How can I get the sum from richtextbox, starting at line -1 ? But the first line should compare with line1.This code adds a constant to all lines and passes the sum to another textbox.
Dim num1 As Single Dim sum As Single Dim Constant As Single = Val(txtLowerTol.Text[code]....
So a third textbox should sum with one line "offset".
i am making a lua editor that highlights reserved words and so.However I stuck in a highlighting part.I've made the reserver-words highlighting function but I got no idea how to make it highlight comment lines.
Could someone please help me? I want a function to search through the richtextbox and find lines that start with "--" and highlight them with green color.
Using this [URL] to retrieve both address and place name at the same time ("//span[@class='listingTitle']|//div[@class='address']/text()[normalize-space(.)]"), I can get a list of placenames and addresses like this in a richtextbox:
The first line is bad, it doesnt have an address. Line 2 and 4 are good, they have addresses. So what I could do is:Check each line,if the following line doesnt contain "numbers + ON" then delete line. This will leave me with PlaceNames followed by addresses, which I will then split every other line into a new textbox, (so I have one textbox with placenames, and another with addresses).
I'm working on a program that inputs a text box text into a RichTextBox via a button click. But when I click a button, it over writes the text that is already in the RichTextBox. How can I prevent this?
I am attempting to hard code a richtextbox that has multiline characters upon the Load_Event. However, whenever I use the "&controlchars.newline _ " I get a syntax error and end of statement expected error.
I am working on a way to determine if the lines of a RichTextBox have changed.I currently use this
Dim newhash As Integer = Me.Text.GetHashCode If newhash <> Me._prevhash Then Me._prevhash = newhash Me._lines = MyBase.Lines
[code]....
But this method has a bad issue: The text property takes a while to "load up" plus getting its hash code adds to it. This code runs every time the Lines are needed (it is a property). So this
For i As Integer = 0 To Lines.Count - 1 Dim line As String = Lines(i) Next
Takes ages to complete, because for every line it checks if the lines have changed.I am trying to evade using MyBase.Lines too much, since that REALLY takes ages to load.
- I can not use the modified property since it is unreliable (set to true if only a text color changes)
- Can't use the RTF since it changes without the text changing (coloring) and the hash code is slow as well.
- Can't use the TextChanged event, since it is sent after the SelectionChanged event (for some reason)
And just a FYI, I've spent about an hour looking this up... and I just can't seem to get it to work the way I wan't to. My application is simple, I have a "batch file editor". It has a richtextbox, a couple buttons for Open/Save/Test which are working fine.All I'm wanting to do is...
There is a richtextbox containing either 'True' or 'False' at each of it's lines. Let's say for example that it contains 100 lines. The 2nd line is 'False'. Through a contextmenustrip I would like to be able to select that 'False' value and have an option saying 'apply to a range' of lines. The program would ask for the number of lines the user would like to apply that value, and apply that value to the lines he specified. [Code]
how to, Search for a pixel and replace it well now im stuck on finding out how i could do shades, So im using this code
Dim newImage As Bitmap = New Bitmap(PictureBox1.BackgroundImage) Dim bmp As Bitmap = DirectCast(PictureBox1.BackgroundImage, Bitmap) For x As Integer = 0 To bmp.Width - 1[code]....
now how could i have it. say if x,y= any shade of black Then.'Take Action' im making my own paint type tool so im jw how i could paint all black even if it is just 1 digit off from 0,0,0'<- Black' give me some example code on how to loop threw some lines of r,g,b values so i could use that in my function
I'm trying to build a sales program in which by adding multiple items in a RichTextBox, with the click of a button, the program can sum the price of these items and put it in a TextBox as the total sum of these values.I've been going nuts about on how to write the code for this..It's the last part of the program that i need to conclude ir.
I'm trying to build a sales program in which by adding multiple items in a RichTextBox,with the click of a button, the program can sum the price of these items and put it in a TextBox as the total sum of these values​​.I've been going nuts about on how to write the code for this..It's the last part of the program that i need to conclude ir.
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
I am getting scale values from a comm port into a richtextbox control, now as long as the connections and the scale is working great scale readings continuously flow into the control all the time, however when the connections or the scale is turned of the label that displays the weight will give a message saying error.
After 5 seconds I want to be able to give the operator the choice to take scale readings manually. This is my code so far.
Private Sub tmScaleTimer_Tick(sender As System.Object, e As System.EventArgs) Handles tmScaleTimer.Tick If rtbDisplay.Text.Length = i Then
[Code].....
how do I restart the timer if the interval has elapsed
I have a button which reads a comma separated value file and loads it into a richtextbox. Each line contains comma separated chars.
Once the file is loaded in the richtextbox, i want to be able to select specific values from each line and store them into an array.
For example: Line1: a,b,c,d,e
I want to be able to place only the values "b" and "c" into an array.
I was thinking something like creating a menu for the richtextbox which will be triggered on right click, then highlight the values I want, press right click and select 'place these values in an array'.
it doesn't have to be the way i proposed it, but it definitely must use a richtextbox.
how to count the lines in textbox1.text (with multiplelines). I don't need to count each character. I only need to count each line from top to bottom in textbox1.text (multiplelines) and I will use Label1 to display the numbers.
I have written a simple script to get a bunch of lines from a text file (they will be filenames eventually) which are split by new lines and puts each one into an array..
Dim ary() As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If My.Computer.FileSystem.FileExists("C:MenuFiles.txt") Then
[code]....
The only thing I can do for now is either use the substring function to remove the first character from all array values after 0 but I don't like that because it's messy and what if the split "works" as I want it to one one of the lines and knocks of the first character when I don't want it to.
I have a richtextbox with a large file inside....I want to be able to search for "Fornication" within the text (KJV Bible) and have every instance of that word to pop up into another richtextbox along with the scripture it is in.