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

RE: Accessing selected text within a richTextBox


Thank you for posting here!

I notice that you post a same issue in the
microsoft.public.dotnet.framework.windowsforms.con trols newsgroup and I
have replied to that thread. For your convenience, I include my reply here.

================================================== ==
As Anders has suggested, you can use the SelectedText or SelectedRtf
property of the RichTextBox class to get the selected text within a
I have tried the Selected Method but it seams that the textbox is losing
focus win I click the button...

Do you mean you get the SelectedText property of the RichTextBox from
within the Click event handler of a Button and find that the RichTextBox
loses the focus after you click the Button? If so, it is and this is
because the Button gets focused after it is clicked.

================================================== ===

If you have any question on this particular issue, please reply to that
thread and I will follow up with you in time.

Thank you for your cooperation and have a good day!

Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:

Get notification to my posts through email? Please refer to

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 23 '08 #1
0 1620

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

Similar topics

by: Charlie | last post by:
I have the following code but I can't get the selected text to highlight correctly. What happens is all the text after the selected text is red. I need to add that after the selected text is...
by: Suhail A, Salman | last post by:
Dear All, I placed a HtmlSelect control on a web page and set it to "Run at Server", the objective of this HtmlSelect control is that the client adds all his accounts to a text box, and...
by: MattB | last post by:
I think I'm close to making this work, but so far it does not. I have a datalist (id = "dlVFields") on a web form that has an item template with a textbox in it. The textbox id = "txtVerify"....
by: TheBinar | last post by:
Hi I have a user control that contains a RichTextBox in vb.net. In my program, I create multiple instances of this control (with the RichTextBox being in each one), that appear one above the...
by: andreas | last post by:
A selected text has fontstyles like bold and italic and underscore I want to remove one of them without changing the other fontstyles. How to do that? Thanks for any response
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to...
by: deepakfordotnet | last post by:
Hi, First of all let me confess that I could not get the solution to the same problem from an earlier post Printing :by Mr.Richard MSL (dated September 24th 2006) working. (Replied by Mr.Walter...
by: Tom | last post by:
I don't want to re-invent the wheel and am looking for a simple implementation of a text viewer or RichTextBox in read only mode that allows rapid file positioning within large data files without...
by: Ignacio Machin ( .NET/ C# MVP ) | last post by:
On Jul 22, 9:41am, "none" <n...@none.comwrote: Take a look at the Selected property of the RichTextBox control
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$) { } ...
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...
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...
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...
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...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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,...
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.