473,779 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does Setting RichTextBox.Sel etcionStart Change RichTextBox.Tex t ?!?!?

After a lot of debugging effort I have to conclude that it does. Or at
least can. I take a substring (RichTextBox.Te xt.Substring) before setting
SelectionStart and after and get a different result. The second result
begins two characters to the right of the first.

In an earlier version of the program I did not have this problem. But in
that version the RichTextBox actually appeared on a form. In the version of
the program with the problem the RichTextBox is never added to a form.

I don't know if I am asking a question or reporting a bug.

Bob
Jul 29 '07 #1
1 1482
Well ... I just wrote a little program to demonstrate the problem and, of
course, it didn't demonstrate the problem! But here's the code which
convinces me that the RichTextBox.Tex t field changes when the SelectionStart
property is set ...

Target = rtb.Text.Substr ing(SSI + SSL + StartAdjust, FSL) 'for debugging
purposes only

rtb.Focus()

Target = rtb.Text.Substr ing(SSI + SSL + StartAdjust, FSL) 'for debugging
purposes only

rtb.SelectionSt art = SSI

Target = rtb.Text.Substr ing(SSI + SSL + StartAdjust, FSL) 'for debugging
purposes only

After the last statement the value of Target is different from the values of
Target resulting from the earlier Target= statements.

"eBob.com" <eB******@total lybogus.comwrot e in message
news:u%******** ********@TK2MSF TNGP03.phx.gbl. ..
After a lot of debugging effort I have to conclude that it does. Or at
least can. I take a substring (RichTextBox.Te xt.Substring) before setting
SelectionStart and after and get a different result. The second result
begins two characters to the right of the first.

In an earlier version of the program I did not have this problem. But in
that version the RichTextBox actually appeared on a form. In the version
of the program with the problem the RichTextBox is never added to a form.

I don't know if I am asking a question or reporting a bug.

Bob

Jul 30 '07 #2

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

Similar topics

14
2519
by: Reply Via Newsgroup | last post by:
Folks, Say I have a table, ten columns, ten rows - Each with a word in it. I want to change the values of some/all of the cells in the table via a hyperlink. How do I reference each cell and change its text contents from a link elsewhere in the page? I have a rought idea that I'll need something like 'id' in my <td> tags but while I have a greater understanding of server-side programming langauges like PHP, javascript is still very new...
4
8873
by: Patrick Noll | last post by:
hi ng, i have a problem when i try to change the text property of a TreeNode just before the user is able to edit this property. Example: // Label before anything happens... TreeNode.Text = "TestNode {ShortCut}"; // when user enters the edit mode, i want to remove the ShortCut entry... TreeNode.Text = "TestNode"; ----
6
9165
by: Roger Ries via DotNetMonster.com | last post by:
I'm trying to change the text in a label from another form. lblInfo.Text = "ABC" Works for the form your currently in but how the heck do you change that label information from another form. Later --
4
6977
by: **Developer** | last post by:
I have a usercontrol that contains the following. To my surprise the form containing this control get KeyUp events. Help says that for KeyPress setting e.Handled = True suppresses KeyPress events but say very little about KeyUp. What does setting to Handled do?
2
13815
by: tom | last post by:
Hi there, In IE, I am trying to govern various style attributes of a DIV tag with javascript. It's no problem doing things like this: 'window.xxx.style.top="100px";' but when I try to change the text alignment with the following: 'window.xxx.style.text-align="left";' .... I get a syntax error probably due to the hyphen.
13
4968
by: sonald | last post by:
Hi, Can anybody tell me how to change the text delimiter in FastCSV Parser ? By default the text delimiter is double quotes(") I want to change it to anything else... say a pipe (|).. can anyone please tell me how do i go about it?
4
2321
by: jimmy.dillies | last post by:
Hello, I have a global variable which does not want to change : <header> .... <script type="text/javascript" language="JavaScript"> var i=1; function swap() { var window.i = 1 - window.i ; } .....
5
443
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the text in the url/location bar? ----------------------------------------------------------------------- This text can only be altered by changing the URL of the page. The normal solution is to use frames, though this can introduce problems of its own. ===
6
6428
by: K Viltersten | last post by:
I have the following button: <asp:LinkButton id="Btn" runat="server" text="Click"> </asp:LinkButton> I have added an action listener in the javascript where I change the text on it: this.dom.textContent = "Clicked"; The change is effective but after the site has reloaded the text is back to "Click".
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.