473,398 Members | 2,113 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,398 software developers and data experts.

Replacing a character at a position in RichTextBox

Al
Hi,
Is there any way to replace a character at a position? Without cussing the
RichTextBox to scroll. For example the following code will replaces the by
removing but the side effect is that it will cause it to scroll.
aRichtext.Text = aRichtext.Text.Remove(position, 1)
aRichtext.Text = aRichtext.Text.Insert(position, "Y")
Nov 21 '05 #1
2 3647
Hi Al,

If I have undestood the solution will be similar to:

aRichtext.Text = aRichtext.Text.Remove(position, 1)
aRichtext.Text = aRichtext.Text.Insert(position, "Y")
aRichtext.Focus()
aRichtext.SelectionStart = position
aRichtext.ScrollToCaret()

I hope that helps.

Kind Regards,

Jorge Serrano Pérez
MVP VB.NET
"Al" wrote:
Hi,
Is there any way to replace a character at a position? Without cussing the
RichTextBox to scroll. For example the following code will replaces the by
removing but the side effect is that it will cause it to scroll.
aRichtext.Text = aRichtext.Text.Remove(position, 1)
aRichtext.Text = aRichtext.Text.Insert(position, "Y")

Nov 21 '05 #2
Al
Thanks Jorge, but it behaves the same as the origional couple lines :(

"Jorge Serrano [MVP VB]" wrote:
Hi Al,

If I have undestood the solution will be similar to:

aRichtext.Text = aRichtext.Text.Remove(position, 1)
aRichtext.Text = aRichtext.Text.Insert(position, "Y")
aRichtext.Focus()
aRichtext.SelectionStart = position
aRichtext.ScrollToCaret()

I hope that helps.

Kind Regards,

Jorge Serrano Pérez
MVP VB.NET
"Al" wrote:
Hi,
Is there any way to replace a character at a position? Without cussing the
RichTextBox to scroll. For example the following code will replaces the by
removing but the side effect is that it will cause it to scroll.
aRichtext.Text = aRichtext.Text.Remove(position, 1)
aRichtext.Text = aRichtext.Text.Insert(position, "Y")

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris | last post by:
Using VB6. With a RichTextbox, I can get the position of the character under the mouse pointer with an API call like: SendMessage(hWnd, EM_CHARFROMPOS, 0&, Pointl) by passing the mouse x,y...
2
by: Hendrik | last post by:
Hi I have searched extensively for help on inserting text at the position of the mouse pointer in a text box as the final step of drag and drop process What I have come with is listed below - the...
0
by: Sakharam Phapale | last post by:
Hi All, How to get the starting and end character position of the given line no in RichTextBox? I have written following code but it takes more time. Is there any RichTextBox function or API...
0
by: John Smith | last post by:
I have text files and I get binary offsets of text portion of these files from VB6 program with RichTextBox. I use VB.Net 2003 and need to select and highlight the text between given offsets....
32
by: FireHead | last post by:
Hello C World & Fanatics I am trying replace fgets and provide a equavivalant function of BufferedInputReader::readLine. I am calling this readLine function as get_Stream. In the line 4 where...
7
by: aine_canby | last post by:
Hi, Im totally new to Python so please bare with me. Data is entered into my program using the folling code - str = raw_input(command) words = str.split() for word in words:
8
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
I have a RichTextBox (rtfTerminal below) in which I would like to replace the last line with the last line minus its last character (i.e., do a backspace). I tried the following code, wherein I...
2
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, I have a somewhat long calculation report printed out in a RichTextBox. To find or monitor a particular value, users scroll down to the location of the data in the RichTextBox. However, when...
5
by: Andrus | last post by:
I use Winforms RichTextBox control to edit scripts. Scripts are plain ascii texts. When error occurs, script engine returns character position of error in code as integer. How to position...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.