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

RichText Box Help pls...

I have added a RTB to my form and found some code online:

rtb1.Rtf = @"{\rtf1\ansi \b Conversion Report\b0.}";

I want to be able to add lines to this box, with different fonts,
sizes, alignment, etc. But I am not sure what I can do with Rtf.

Obviously /b is for bold, but what else is there? Is there a link
with explanations on what I see above and more useful stuff?

Thanks!

Dec 21 '07 #1
5 1048
The latest I could find for the Rich Text Specification is for Word
2002, but it should do what you need:

http://www.microsoft.com/downloads/d...DisplayLang=en
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Soulless" <dg*******@gmail.comwrote in message
news:5e**********************************@e23g2000 prf.googlegroups.com...
>I have added a RTB to my form and found some code online:

rtb1.Rtf = @"{\rtf1\ansi \b Conversion Report\b0.}";

I want to be able to add lines to this box, with different fonts,
sizes, alignment, etc. But I am not sure what I can do with Rtf.

Obviously /b is for bold, but what else is there? Is there a link
with explanations on what I see above and more useful stuff?

Thanks!

Dec 21 '07 #2
Dom
This might start you off. Play around with the Method "Select", and
then look at the SelectionXXX properties, such as SelectionBackColor,
SelectionFont, SelectionColor, and so on.

Dom
On Dec 21, 12:38*pm, Soulless <dgmsal...@gmail.comwrote:
I have added a RTB to my form and found some code online:

rtb1.Rtf = @"{\rtf1\ansi \b Conversion Report\b0.}";

I want to be able to add lines to this box, with different fonts,
sizes, alignment, etc. *But I am not sure what I can do with Rtf.

Obviously /b is for bold, but what else is there? *Is there a link
with explanations on what I see above and more useful stuff?

Thanks!
Dec 21 '07 #3
On Dec 21, 11:55*am, Dom <dolivas...@gmail.comwrote:
This might start you off. *Play around with the Method "Select", and
then look at the SelectionXXX properties, such as SelectionBackColor,
SelectionFont, SelectionColor, and so on.

Dom

On Dec 21, 12:38*pm, Soulless <dgmsal...@gmail.comwrote:
I have added a RTB to my form and found some code online:
rtb1.Rtf = @"{\rtf1\ansi \b Conversion Report\b0.}";
I want to be able to add lines to this box, with different fonts,
sizes, alignment, etc. *But I am not sure what I can do with Rtf.
Obviously /b is for bold, but what else is there? *Is there a link
with explanations on what I see above and more useful stuff?
Thanks!- Hide quoted text -

- Show quoted text -
Thanks guys, the problem I have is I am building the text as I go and
want to add bold text, normal text, etc etc... using selectedXXXX
requires the text to be selected, right?
Dec 21 '07 #4
Dom
I believe it is easiest to just get the string, and then use the usual
methods, SelectionXXX, etc, to dress it up.

Dom

On Dec 21, 2:16*pm, Soulless <dgmsal...@gmail.comwrote:
On Dec 21, 11:55*am, Dom <dolivas...@gmail.comwrote:


This might start you off. *Play around with the Method "Select", and
then look at the SelectionXXX properties, such as SelectionBackColor,
SelectionFont, SelectionColor, and so on.
Dom
On Dec 21, 12:38*pm, Soulless <dgmsal...@gmail.comwrote:
I have added a RTB to my form and found some code online:
rtb1.Rtf = @"{\rtf1\ansi \b Conversion Report\b0.}";
I want to be able to add lines to this box, with different fonts,
sizes, alignment, etc. *But I am not sure what I can do with Rtf.
Obviously /b is for bold, but what else is there? *Is there a link
with explanations on what I see above and more useful stuff?
Thanks!- Hide quoted text -
- Show quoted text -

Thanks guys, the problem I have is I am building the text as I go and
want to add bold text, normal text, etc etc... using selectedXXXX
requires the text to be selected, right?- Hide quoted text -

- Show quoted text -
Dec 21 '07 #5
On Fri, 21 Dec 2007 11:16:02 -0800, Soulless <dg*******@gmail.comwrote:
Thanks guys, the problem I have is I am building the text as I go and
want to add bold text, normal text, etc etc... using selectedXXXX
requires the text to be selected, right?
You can save the current selection, select the text you want to format,
change the formatting as desired, and then restore the original selection.

Also, you can write some test code to just apply certain kinds of
formatting you're interested in, and then look at the RTF text that
results. In that way, you can figure out what RTF to apply yourself for
specific results, if you don't want to do the above to set formatting in
your actual application.

Pete
Dec 21 '07 #6

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

Similar topics

1
by: Pete Griffint | last post by:
Howdy! I want to get the following in a Richtext control: Paragraph 1.... Paragraph 2... Obviously I want to do something like rtb.SelectedText="Paragraph 1...";...
0
by: Lukas Thanei | last post by:
Hi, Im trying for 2 days to solve a problem but now Im on a point where all ideas exhausted. Im writing a software to print out some cards containing richtext and images. To print the...
2
by: Du | last post by:
I like richtext textbox and its shortcut, but I don't need the richtext format. How do I tell the richtext text box to strips all the format and convert everything to plain text? Thanks
4
by: JC - home | last post by:
Hello.. I've been having some problems for a little while with this which I was sure I would beat...hmmm. Anyway, I have a form with two rich textboxes. One at the top which is to display a...
2
by: Gary Shell | last post by:
I have a very ODD situation. I have a RichTextBox and a button. In the button click event I have the following: me.richtextbox1.SelectedText="test" Assuming I start with "aaaabbbbcccc" in...
3
by: rigamonk | last post by:
Is there a way to save richtext from a richtextbox into an access DB using vb.net? thanks patrick
1
by: Andrea V.F. | last post by:
I have a Read-Only RichText and I load the content from a RTF file containing images and text. The problem is that only text is read-only while images can be resized and moved. I would like that...
3
by: tlyczko | last post by:
I have Stephen Lebans' RichText control on a subform, which is bound to a memo field. The only editable control on this subform is the rich text control for the memo field. When the main form...
6
by: Tomo | last post by:
How to use RichText in ASP.NET application. I need to make web page where user can write some text, click save and than this content must be saved as html content. Can I find some richtext control...
0
by: giddy | last post by:
hi , i made a little RtfEncapsulator. Its a class thats called RichText , it has an RtfElementCollection which takes any class that exposes the IRtfElement interface. I managed to make an...
0
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...
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
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...
1
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
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.