473,387 Members | 1,512 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,387 software developers and data experts.

Does Setting RichTextBox.SeletcionStart Change RichTextBox.Text ?!?!?

After a lot of debugging effort I have to conclude that it does. Or at
least can. I take a substring (RichTextBox.Text.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 1465
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.Text field changes when the SelectionStart
property is set ...

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

rtb.Focus()

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

rtb.SelectionStart = SSI

Target = rtb.Text.Substring(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******@totallybogus.comwrote in message
news:u%****************@TK2MSFTNGP03.phx.gbl...
After a lot of debugging effort I have to conclude that it does. Or at
least can. I take a substring (RichTextBox.Text.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
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...
4
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 =...
6
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. ...
4
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...
2
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...
13
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...
4
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
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the text in the url/location bar?...
6
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:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.