473,385 Members | 1,606 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.

few glitches in my richtext encapsulator

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 RtfTextElement which works really well.

So to add text this has to be done:
Code:

RichText richText = new RichText();
richText.ColorTable.Add(new RtfColor(Color.BlueViolet));
richText.FontTable.Add(new RtfFont(Font));
RtfTextElement txt = new RtfTextElement("Hello??");
txt.IsNewPara = true;
txt.Color = richText.ColorTable[0];
txt.Font = richText.FontTable[0];
txt.Alignment = TextAlignment.Centered;
richText.Elements.Add(txt);
But my table element does'nt work very well!

Code:

RtfTableElement table = new RtfTableElement();
table.ColumnCount = 3;
RtfTableRow row = new RtfTableRow();
row.Add(txt); row.Add(new RtfTextElement("Col2"));
row.Add(new RtfTextElement("Col3"));
table.Rows.Add(row);
richText.Elements.Add(table);
for one , i just make all the columns 1 inch wide.I want to be able to
set/get *pixel values* for _each_ column , to do that i need DPI to
calculate it , and i need an instance of the graphic class. I planned
to make a internal property for that , but there no generic way to
handle this!??

Also , it seems the .NET RichTextBox does'nt wrap a sentance in a
table cell! Does anyone know the control for that!?? Word and Wordpad
are do it fine.

Heres the source:
http://gidsfiles.googlepages.com/RichTextCore.cs
http://gidsfiles.googlepages.com/RichTextElements.cs
Thanks

Gideon

Jun 8 '07 #1
0 1142

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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
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...

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.