RichTextBox On Click Select The Lines?

Jun 20, 2012

when I click on rtb how do I assign clicked line (text of that line) to a variable 'x' and a line below to a variable 'y'? I have so far this

SendKeys.Send("{DOWN}") 'Move cursor to next line
SendKeys.Send("{HOME}+{END}") 'Select the line

View 1 Replies


ADVERTISEMENT

RichTextBox | Select Line On Click?

May 24, 2012

Im Stuck On another project.I Have a Read Only RichTextBox, and I Want to make it so when I click on a line of text in the richtextbox, that it selects or Highlights the whole line, and Just that one line.

View 2 Replies

Word Wrapping - Cannot Select Last Line Of Richtextbox (when A Line Is Wrapped It Becomes Two Lines)

Jul 5, 2009

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]...

View 3 Replies

Add Lines In RichTextBox?

Aug 6, 2009

How to make RichTexBox when open a file to show the lines .To be like Notepad++ when open a file shows lines: Image:

Like .txt file thise sentences:

Hello!

How are you?

I'm Ok, Thanks for asking.

and when i start the program and open the file in richtextbox to show the lines of sentences . Like thise:

1. Hello!

2. How are you?

3. I'm ok, Thanks for asking.

How to be done? Because i'm using search button that show the word on what line is it.. so i need the lines people to know what line to search

View 1 Replies

Add Values Richtextbox Lines

Mar 4, 2010

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.

View 1 Replies

Number Lines In A RichTextBox?

Aug 20, 2010

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]

View 1 Replies

Richtextbox Highlight Every Ten Lines?

Aug 23, 2011

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)

View 1 Replies

Compare Offset Lines Richtextbox?

Mar 4, 2010

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".

View 6 Replies

Delete The Spaces And Lines And @ From RichTextBox?

May 5, 2012

I want Split @ and " " and Chr(13) From RichTextBox? How do I delete the spaces and lines and @ From RichTextBox?

View 4 Replies

Highlight Single Lines In A RichTextBox?

Aug 20, 2008

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.

View 3 Replies

Save The Richtextbox Lines Into A Listbox?

Oct 6, 2011

I have a Richtextbox.Text in my project and I need to save all text lines into a ListBox.Text .

View 6 Replies

Switching Values In A Richtextbox Lines?

Dec 14, 2009

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.

View 6 Replies

VS 2008 Multiple Lines In RichTextBox?

Aug 26, 2009

How would I make it so that if someone presses a button, the richtextbox will have more then 1 line of text

RichTextBox1.Text = "Something like this, but 2+ lines"

View 6 Replies

Delete Lines In Richtextbox That Fall Under The Condition?

Sep 11, 2010

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:

jh ryder machinery limited
convenience storage ltd 3344 rideau
rd, gloucester, on, k1g3n4
kitchen interiors 146 colonnade rd,
nepean, on, k2e7y1

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).

View 1 Replies

Forms :: Insert Multiple Lines Into Richtextbox?

Mar 27, 2010

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?

View 2 Replies

How To Hard Code Multiple Lines In A Richtextbox

May 18, 2010

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.

[Code]...

View 3 Replies

Random Lines Fom Text File Into Richtextbox?

Jan 31, 2010

basically ive tried a few different methods which i have come accross by searching but none seem to work.

code so far after removing everything that didnt work is as follows

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class

im makng a spelling test type application so that each word is on a different line and that are displayed in a random sequency.

View 8 Replies

VS 2008 - How To Highlight Multiple Lines In RichTextBox

Jul 14, 2009

How to highlight multi lines in Rich Textbox and know which lines are highlighted?

View 8 Replies

VS 2008 RichTextBox - Determine Lines Have Changed?

Apr 23, 2011

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)

View 4 Replies

Make Program Click Button And Select File Using A OpenFileDialog And Click Send On Computer

Jan 31, 2009

How can I make a program so you click a button and select a File using a OpenFileDialog and click send on your computer and it will send the file to a different computer and then a SaveFileDialog will show asking where to save the file on the other computer. Oh ya I cant use WinSock or whatever becuase im using Windows Vista 64 Bit. I need it because I for some reason cant use printer sharing. It might be because im on A 64bit Vista Machine and I want to print a file off of a 32bit XP Home Machine.

View 6 Replies

Writing Multiple Lines To Richtextbox With Link Label

Apr 11, 2011

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...

[Code]...

View 4 Replies

Listbox And Streamreader - Select More Than One And Have The Whole Of The Lines Loaded?

Sep 24, 2009

Using Visual Studio 2008

I have a Listbox where i use OFD to list selected text filenames, can be multiple and from different drives

[code]...

I would like to be able to select more than one and have the whole of the lines loaded. I have tried many approaches, 'For each line' for example, but cant get my head around it. Another issue is that i would only like to see the textfile name in the listview box instead of path and filename.

View 7 Replies

Select Multiple Lines Then Push That Out To A Single Variable

Nov 20, 2011

I have a listview box. I load the listview up from a text file and everything is divided into three groups. I need to be able to select multiple lines then push that out to a single variable, separated by commas. Two things are happening that are problematic:

1) If I just have it set to smallicons and no checkboxes, anything I select is highlighted right up until the control loses focus at which point everything un-selects.

2) If I turn on checkboxes, I can click boxes and they stay selected when I lose focus BUT the checkboxes are cut off on the left side of the control. (The checkbox appears to go off the edge of the control.) There's plenty of space in the control for the checkbox and the listed items.

View 4 Replies

Select Random Number Of Lines From A Text File?

Jan 15, 2012

Im making a text based game that i need to randomly select different numbers of lines from a text file then pass them to a list box.[code]...

First the code needes to identify the 4th element then randomly select lines from lines that contain that element. The code needs to work out how many lines have a matching text to the 4th array then randomly select lines from that total no need for a maximum limit to that number.The same line must only been show the once at a time, but It can then be shown again on a different button click.[code]...

View 3 Replies

Select A Line Of Text In A RichTextBox?

Jun 13, 2010

I have a RichTextBox in a VB2008 Windows Form application. The RichTextBox has tabs set at 250 and 400. The following code snippet is used to populate the RichTextBox using the result of a LINQ query.

rtbData.AppendText(String.Format("{0}.
{4}{1}. {4}{2}{3}", strTitle, strAuthor, strBook, ControlChars.CrLf, ControlChars.Tab))

I've noticed that most of the time it takes several mouse clicks to highlight a desired line of text in the RichTextBox. Is there some code that will allow selecting the entire line that a user clicks on? The length each line in the RichTextBox is not the same.

View 3 Replies

Select Image In Richtextbox At Runtime?

Jul 7, 2010

I was wondering how can I select all of the images in a richtextbox at runtime .For example, suppose a file is loaded into a richtextbox control (system.windows.forms) [code]...

View 2 Replies

Draw Lines With Button Click?

Nov 1, 2009

Firstly I am using Vb 2008 Express Edition.I have the following code:

Code:
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e _
As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim x1 As Integer = 0
Dim x2 As Integer = 50

[code]....

When I run the above code it works , no problem. But I want to trigger it only on my Button_click event.

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub

I don't know how to call the PictureBox1_Paint into my Button1_Click

View 7 Replies

Select All The Chars That Fall On A Known Line Of A Richtextbox?

May 18, 2009

I need a command that will select all the chars that fall on a known line of a richtextbox.

View 2 Replies

VS 2010 Select Word In Richtextbox.text

Jan 8, 2012

i have this code to select a word in richtextbox.text

[Code]...

i want to select all the word Hello and color it.how can i do that

View 1 Replies

VS 2008 Select Only Text (excluding Images) In A RichTextBox?

Jul 1, 2010

I want to select all text in a richtextbox excluding any images in it.richtextbox1.SelectAll() will select all objects in the richtextbox not only the text

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved