Richtextbox - Place Cursor At Row?
Apr 9, 2009How do you make the cursor go to a specific row in a richtextbox (or) select everything in that row?
RichTextBox1.Select(0, 2)?
How do you make the cursor go to a specific row in a richtextbox (or) select everything in that row?
RichTextBox1.Select(0, 2)?
I have 9 Text boxex and one command button and I'm looking for a code such that IF i set my cursor on a specific textbox using the mouse then I can be able to Input text in the textbox using the command button.
View 7 RepliesI am using this line of code to place a special character in a textbox at the cursor location:
Me.RichTextBoxPrintCtrl0.Text = Me.RichTextBox.Text.Insert(cursorloc, "ῳ")
It works good, but after it has been done, if you try to undo the action by pressing control Z, for example, it is not undoable. Is there a way to make the action undoable?
I have a text box with some text inside it;
the text is long (say 100 chars);
the textbox can display about 20 chars.
The following code:
tbxTest.SelectionStart = 5
tbxTest.SelectionLength = 60
selects a part of the text and sets the cursor (blinking beam) at the and of the selection, in this case the first caracters of the selected text is out of the user sight because the textbox is too small to display the entire selection.
Is it possible to force the cursor to be at the beginning of the selection so the first part of the text is visible? (as if I had selected my text with the mouse dragging from the end back towards the beginning)
i need to togglie selection form a string in a rich text box and put careet one space forward.
View 1 Replieshow to get the image path and place it on a richtextbox,get the path or directory of the image file that I was chosen in a opendialog ..
View 2 RepliesI am currently stuck on trying to collect some string items from a richtextbox and then count how many items there are. I then want to relocate one of the string items if there are more than three into another richtextbox.I currently have been attempting to capture the string items into an array but I have had no luck.The items in the richtextbox are
Laura Philips
Jaime Jarvis
Rachel Dawkins
So in this case I would want to remove the last entry "Rachel Dawkins" and place it into another richtextbox.
I made my irc client. It sends & receives to a richtextbox like this :
Well, you might know mirc or nns, there it is like this :
How can I do it the same, so all the text is at the same place, under eachother, like on the second screenshot.
& another question : How do I color words in a richtextbox ? I tried Selectionstart = Find("blablabla")& selectioncolor = color.red
but that selection dissapears when someone send a new comment.
Trying to set the cursor position in a RichTextBox. The contents of a document are opened into the RichTextBox and I would like the cursor to move to the very start of the text.
At the moment, I'm using:
Me.tbLowerBody.SelectionStart = 0
Me.tbLowerBody.SelectionLength = 0
However, this seems to provoke my "Would you like to save changes" dialog on closing the RTB even though no actual changes have been made.
How do you change the shape of a cursor in a richtextbox?
View 5 Replieshow to find the x,y coordinates of where my cursor is in an editing control like richtextbox. I don't need the mousepointer coordinates but the editor's cursor position.I found this VB code to achieve this. How can I convert it to vb.net ? Or is there a simpler solution ?
View 6 RepliesHow to get the line number where the cursor is in a RichTextBox? I'm using VB 2010
View 2 RepliesI Would like to position the cursor in a text box using X,Y coordinates with X being the line number and Y being the column number. Is there any way to determine the line and column numbers of a textbox that is full of text. Using the .selectionstart paramenter only lets you position the cursor a certain distance from the beginning of text but there is no line information that I know of. By the way, I not an expert at VB so bear with me if these questions seem kind of basic.
View 6 RepliesIs it possible to append text into a RichTextBox1 where the cursor is? (Ex: In-putting a string from TextBox1 to RTB1 where the user has the typing cursor at.)
View 2 RepliesI have a couple of TextBoxes on a Form and also a RichTextBox control which is associated with a ContextMenu1. Now, while my MouseCursor still blinks friendly in one of my TextBox controls, I right-click the RichTextBox and get surely my ContextMenu1. However, this ContextMenu won't do me any good unless I first left-click my RichTextBox in order to set my cursor in there and then right-click again to open the ContextMenu. I've tried to work with RichTextBox.Focus() and also with something like ... If
e.Button = Windows.Forms.MouseButtons.Right Then ...
But nothing seems to do the trick.
I am trying to implement a feature that would allow me to move the cursor to the end of a line in a Rich Text Box. Is that possible?
View 2 RepliesI'm writing an vb.net application so that the user can type text to be added to a website. I'm using a richtextbox and I've added the facility to hyperlink selected text. This all works, but when the mouse cursor moves over a hyperlink it changes to a hand; how do I stop it doing that? It's confusing for the user as it looks like clicking the link will do something and it makes it awkward to correct spelling within the text of the hyperlink.
View 3 RepliesI am using a WPF richtextbox to create a syntax highlighter for code provided in a textbox. I want to have it automatically adjust the rich textbox as I am typing, using a thread timer I reset the contents of the rich textbox. I am trying to keep the cursor where it is suppose to be. I don't loose any text characters during the parse (except line breaks).
I don't know how to keep the caret position where the user has left it in the text. It defaults to the end of the document. I attempt to store the current caret position in the text and then set it to the document after I make my changes, however the error I receive is "Cannot set CaretPosition to be outside of RichTextBox." So I set the caret position to the bottom of the document.
WPF, VB.net, .net Framework 4.0
Here is the code.
Public Sub FormatText()
If IsNothing(rtfContent.Document) Then
Exit Sub
End If
Me.rtfContent.IsEnabled = False
[Code] .....
Is there a way in the RichTextBox to change the Blinking cursor to a blinking _ like is dos or hide it all together? Or is there another object that I can use to simulate a dos prompt without it actually being a dos prompt where I can write text to it via code?
View 5 RepliesAnyone know how to make the text cursor (claret) wider in a RichTextBox control? It seems to ignore the setting in Vista settings and does its own thing instead. I wouldn't describe my vision as being seriously impaired - just middle aged!
On a high resolution screen it is a real chore trying to find the text cursor position. I've ended up doing a heavy kludge of putting a little image of an arrow on the screen attached to a timer control to track and point to the cursor position!!! This is a very silly work around. It must be possible to make the text cursor wider somehow? It is only one pixel wide and I can barely see it. I can't be the only one who struggles with these narrow cursors?
Like I imagine everyone, I often have problems navigating my code because the flow can jump from place to place. For example, if my code calls routine1, and I then want to go to routine1's code, I know that I can click in the dropdown menu and it will take me to that sub. But wouldn't it be easier if I could somehow right click on the call to routine way and select something like 'take me there' which would transport me from the function making the call to the code for the function being called? Then it would be easy to hop from place to place.
View 1 Replieshow can i make my cursor to jump to the next textbox after i type the digit
View 3 RepliesHow copy folder with its content from place to another place. example from C: to D:
View 15 RepliesThis VS010 solution is not providing my intended outcome as a custom override of a 'crosshair' or 'reticle' cursor e.Graphics.DrawPath() is the function that isn't working. This
WORKING solution demonstrates how it's supposed to work. The additonal PictureBox added to a Panel is, for reasons I don't understand, not allowing the 'new' cursor to appear.
Option Explicit On
Option Strict On
Imports System.Drawing
[Code]....
I have a user control, and want to be able to update its cursor while it is disabled. For example, say that I have a user control whose cursor is Default. The below code works ONLY when the user control is already enabled; if it is disabled the below code doesn't work and the cursor remains Default: Me.MY_USER_CONTROL.Cursor = System.Windows.Forms.Cursors.WaitCursor
View 3 RepliesHow can I set the curosr to 'cursor.wait' for the whole display screen and not just for the application form? I have tried "Windows.Forms.Cursor.Current = Cursors.WaitCursor" And several variations but without success.
View 5 RepliesI have a custom cursor that I have as a ico file as cur files are only mono coloured and 32x32.
The only problem in using a ico file is that I can't set where the hot spot is and at the moment it is set in the middle of the icon which is no help
I was looking on the msdn website and it said to set the hotspot like this
Dim instance As Cursor
Dim value As Point
value = instance.HotSpot But I don't know how to set the point value to (0,54) which is where I want the hotspot to be located.
My form cant move i set none to formborderstyle and made my form transparent using
CODE:
So now i cant move my form from place to place.
I am learning Visual Basic 2010 and I am working on a space combat program for my own education and amusement (a simulation of the Honorverse space combat system). I have a routine to add ships to the enemy ship roster and then place them randomly on the viewscreen. When I step through the sub with the debugger, it works fine, but when I run it without stopping, it wants to place all the objects in the same place on the screen. It's actually assigning 2 random numbers pertaining to the size of the viewscreen and assigning those numbers to GameObjectScreenLocation through GameObjectWorldLocation.X and GameObjectWorldLocation.Y. The objects are fully initialized to 0 in their constructor, FYI. Code is below:
[Code]....
I am currently writing a custom control, for a future project. The control uses custom cursors, but sometimes this strange error appears: Code generation for property 'Cursor' failed. Error was 'CursorConverter' is unable to convert 'System.Windows.Forms.Cursor' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.
[Code]...