Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Tue, 22 Jul 2008 16:52:16 -0400,    group: microsoft.public.dotnet.framework.windowsforms.controls        back       


Accessing selected text within a richTextBox   
All
I was wondering if someone could point me to a simple step-by-step C# 
example of accessing selected text within a richTextBox... The functionality 
I'm looking for is ultimately the kind you get with a toolbar shortcut (ie: 
bold selected text) but I'm so new to .Net, I can't figure out how to 
reference a selection of text within the richTextBox.
Any help on this matter would be greatly appreciated.  Thanks in advance. - 
CES
date: Tue, 22 Jul 2008 09:41:58 -0400   author:   none

Re: Accessing selected text within a richTextBox   
On Jul 22, 9:41 am, "none"  wrote:
> All
> I was wondering if someone could point me to a simple step-by-step C#
> example of accessing selected text within a richTextBox... The functionality
> I'm looking for is ultimately the kind you get with a toolbar shortcut (ie:
> bold selected text) but I'm so new to .Net, I can't figure out how to
> reference a selection of text within the richTextBox.
> Any help on this matter would be greatly appreciated.  Thanks in advance. -
> CES
>
>  QMARK.GIF
> 1KViewDownload
>
>  ARROW.GIF
> 1KViewDownload

Take a look at the Selected property of the RichTextBox control
date: Tue, 22 Jul 2008 07:47:10 -0700 (PDT)   author:   Ignacio Machin ( .NET/ C# MVP )

Re: Accessing selected text within a richTextBox   
"none"  skrev i meddelandet 
news:eaJIxCA7IHA.2260@TK2MSFTNGP03.phx.gbl...
> All
> I was wondering if someone could point me to a simple step-by-step C#
> example of accessing selected text within a richTextBox... The 
> functionality
> I'm looking for is ultimately the kind you get with a toolbar shortcut 
> (ie:
> bold selected text) but I'm so new to .Net, I can't figure out how to
> reference a selection of text within the richTextBox.
> Any help on this matter would be greatly appreciated.  Thanks in 
> advance. -
> CES
>

Use richtextbox selection properties. Like richTextBox.SelectedText or 
SelectedRtf if you would like to keep the rtf formatting,
SelectionColor, SelectionBackColor, SelectionFont and so on.

e.g. string str = richtextBox1.SelectedText;
date: Tue, 22 Jul 2008 16:53:41 +0200   author:   TAB

Re: Accessing selected text within a richTextBox   
I have tried the Selected Method but it seams that the textbox is losing 
focus win I click the button...

"none"  wrote in message 
news:eaJIxCA7IHA.2260@TK2MSFTNGP03.phx.gbl...
> All
> I was wondering if someone could point me to a simple step-by-step C#
> example of accessing selected text within a richTextBox... The 
> functionality
> I'm looking for is ultimately the kind you get with a toolbar shortcut 
> (ie:
> bold selected text) but I'm so new to .Net, I can't figure out how to
> reference a selection of text within the richTextBox.
> Any help on this matter would be greatly appreciated.  Thanks in 
> advance. -
> CES
>
>
>
>
>
>
date: Tue, 22 Jul 2008 11:02:51 -0400   author:   none

Re: Accessing selected text within a richTextBox   
Sorry my bad I was setting the text property to an empty string... thanks 
for the help - CES

"none"  wrote in message 
news:eaJIxCA7IHA.2260@TK2MSFTNGP03.phx.gbl...
> All
> I was wondering if someone could point me to a simple step-by-step C#
> example of accessing selected text within a richTextBox... The 
> functionality
> I'm looking for is ultimately the kind you get with a toolbar shortcut 
> (ie:
> bold selected text) but I'm so new to .Net, I can't figure out how to
> reference a selection of text within the richTextBox.
> Any help on this matter would be greatly appreciated.  Thanks in 
> advance. -
> CES
>
>
>
>
>
>
date: Tue, 22 Jul 2008 11:11:25 -0400   author:   none

Access Table not accepts RTF Formatted text.   
All,
I'm trained to figure out a simple example of connecting to a database. 
unfortunately I'm running into problems.  I'm using Access 2007 as my back 
end database (because I'm familiar with Access and don't want to add the 
complexity of a SQL database that I have never worked with before) while I'm 
learning C#.

I have a memo field in an Access Table that accepts RTF Formatted text (this 
field works perfectly in Access).  When I past the text into the field on my 
form, the text looks as it should, for test purposes I'm using C# code, in 
the example below private & null would be blue and IContainer would be light 
Blue:

private System.ComponentModel.IContainer components = null;


... however when I navigate away from the row all font information is lost? 
If anyone has any suggestions would be greatly appreciated.  Thanks in 
advance. - CES
date: Tue, 22 Jul 2008 16:52:16 -0400   author:   CES

Re: Access Table not accepts RTF Formatted text.   
I haven't played with this but just a thought, I remember reading this is 
stored as HTML.  I remember,
http://allenbrowne.com/Access2007.html
again this might be a hint.
"CES"  wrote in message 
news:u%23ilTzD7IHA.4204@TK2MSFTNGP03.phx.gbl...
> All,
> I'm trained to figure out a simple example of connecting to a database.
> unfortunately I'm running into problems.  I'm using Access 2007 as my back
> end database (because I'm familiar with Access and don't want to add the
> complexity of a SQL database that I have never worked with before) while 
> I'm
> learning C#.
>
> I have a memo field in an Access Table that accepts RTF Formatted text 
> (this
> field works perfectly in Access).  When I past the text into the field on 
> my
> form, the text looks as it should, for test purposes I'm using C# code, in
> the example below private & null would be blue and IContainer would be 
> light
> Blue:
>
> private System.ComponentModel.IContainer components = null;
>
>
> ... however when I navigate away from the row all font information is 
> lost?
> If anyone has any suggestions would be greatly appreciated.  Thanks in
> advance. - CES
>
date: Tue, 22 Jul 2008 17:18:58 -0400   author:   Pete D.

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us