473,790 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

few glitches in my richtext encapsulator

hi ,

i made a little RtfEncapsulator . Its a class thats called RichText ,
it has an RtfElementColle ction 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.ColorT able.Add(new RtfColor(Color. BlueViolet));
richText.FontTa ble.Add(new RtfFont(Font));
RtfTextElement txt = new RtfTextElement( "Hello??");
txt.IsNewPara = true;
txt.Color = richText.ColorT able[0];
txt.Font = richText.FontTa ble[0];
txt.Alignment = TextAlignment.C entered;
richText.Elemen ts.Add(txt);
But my table element does'nt work very well!

Code:

RtfTableElement table = new RtfTableElement ();
table.ColumnCou nt = 3;
RtfTableRow row = new RtfTableRow();
row.Add(txt); row.Add(new RtfTextElement( "Col2"));
row.Add(new RtfTextElement( "Col3"));
table.Rows.Add( row);
richText.Elemen ts.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 1166

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

Similar topics

1
1600
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..."; rtb.SelectedText=<paragraph break>; (*)
0
1193
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 richtext im using an windows api call (Sendmessage EM_FORMATRANGE - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_RichTextBox.asp). Because I have to print background images, the richtext background should be
2
4615
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
1744
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 concatenated summary, and one at the botton for making a new entry. When items are added in from the bottom box, I do this via a class
2
2373
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 the richtext box and I place the caret between the a and b and hit the button. I get "aaaatestbbbbcccc" as expected. Then I click between the b and the c and hit the button I get:
3
2042
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
1115
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 also images are readonly. Is there a solution?? Thanks, Andrea
3
1893
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 opens, the first record of the subform cannot be typed into. The only way to fix this is to page to the next record, then page back to the first record, then one can type into the rich text control to
6
2138
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 or I need to use javascript?
0
9512
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7530
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5422
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.