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

Rich TextBox

I am using Framework v1.0 (C#).
My question about richtextboxes is:
I have been choosing a location in the text box string doing the following:
....
textbox.SelectionLength = 0;
textbox.SelectionStart = myPos;
....
After setting the position I have been inserting text by calling:
....
textbox.SelectedText = "Testing";
....

I discovered that the new SelectionStart after using SelectedText is: myPos
+ 7. 7 being the length of the selected text inserted. This has worked
well for me but it has been brought to my attention that this might be a bug
in the RichTextBox and I shouldn't rely on this and SelectionStart should
really be myPos after using SelectedText. Is this true?

I find this to be very useful because if I use SelectedText again say:
....
textbox.SelectedText = "NewString";
....

The result would be:
"TestingNewString "
and not
"NewStringTesting"

It seems very natural to move the SelectionStart after using SelectedText,
am I wrong?

Thanks in advance,
Eric

(PS: is posted the same question in the Framework forum but since so many
more people view this forum I posted it here too.)
Nov 16 '05 #1
0 831

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

Similar topics

1
by: bala | last post by:
hi there the senario - an A2k application is distributed as a mdb to various users. they are not packaged. rich textbox is being used in one form. requirement - in some of the user's machine...
3
by: hermawih | last post by:
Hi , can anyone help me , please . In Ms Rich textbox control , It is easy to insert object than to insert picture . I want to insert picture in my Ms rtf activeX control but Ms Access does...
4
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
5
by: BarryM | last post by:
could somebody please tell me how to search a rich textbox for a particular word and then highlight that word in the rich textbox ; ; on the form theres are textbox called txtsearch, a button...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.