Does anyone know how to create a shaded box in a RichTextBox that would look like the one you see when something is quoted in a post?
For example
Printable View
See what you think of this. If it isn't the right shade, let me know and I'll play around some moreCode:Private Sub Form_Load()
RichTextBox1.BackColor = &HCECECE
End Sub
Sorry if I mislead you Hack but what I meant was that I wanted to reproduce the look of, for example, the entirety of post #1 in a richtextbox. In other words a shaded box within the RTB. It will take modifications to the RTB's TextRTF property and I've done a bunch of that in my Private Message Viewer (shameless plug), but so far I haven't been successful with the box. BTW if you or anyone else is interested here is the official RTF spec sheet.
From that RTF spec sheet, it appears you will want to apply "paragraph borders"
Marty
I have not worked with RichTextBoxes, but, is it possible
to use the Line method in one?
If so, perhaps you could set ForeColor to light gray, and use the BF
parameters. There would be several tricky aspects to this:
-- 1. getting the correct x,y coordinates
-- 2. the shaded area would need to be "painted" before the text is added,
or else the text would be "wiped out" by the fill.
If that doesn't work, is it possible to embed a RichTextBox control
in a RichTextBox? If so, the embedded controls could possibly be
a control array (for multiple uses) -- would that do you any good?
Spoo
hello, two suggestions, because you do not create a bitmap simulating an appointment, by graphical methods which would be much easier to create it.
the second and the best, because it uses a webbrowser in replacement of the RichTextBox where you can work more freely.
Could you insert a table with one row one column: I can upload the rtb editor
I just now found some code on the web by our member and rtf-wizard moeur, but upload what you have anyhow.
from the date i put on the folder, that would probably be me. i just added the table before i posted. The table i copied from my app. in my app it opens a form
to display how many columns, centered and width options. i have noticed that typing into the table the text can run past the table borders and not contained within the table.
Oh how I hate richtext.
I tried to modify the code so that I can set a row's height to 1000 twips using the \trrh row height parameter and as you see here the Debug.Print display of strInsert looks like
but when strInsert is inserted into the rich text the result isQuote:
{\colortbl ;\red221\green221\blue221;}
\highlight1\par\trowd\trqc\trgaph10\trleft36\trrh1000\cellx8248\pard\intbl Originally Posted by MartinLiss\cell\row
\pard
\par
Grrrrr.Quote:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}}
{\colortbl ;\red221\green221\blue221;}
\viewkind4\uc1\pard\highlight1\f0\fs17
\par \trowd\trgaph10\trleft36\trqc\cellx8248\pard\intbl Originally Posted by MartinLiss\cell\row
\pard
\par
\par }
Too bad you've gone so far using RTF markup already.
The DHTMLEdit control in "browse mode" make a nice alternative document canvas. I prefer it to a WebBrowser control because you can use it for input as well in "edit mode." Like the difference between a Label and a TextBox.
RTF itself just isn't as human-friendly as HTML + CSS even though they're both plain-text markup. HTML and CSS are well documented for the Trident rendering engine underlying most of Microsoft's HTML software - right in your MSDN Library. IE, MSHTML, WebBrowser control, and DHTMLEdit control all use the Trident engine.
i have verified the table matching the fonts height:
If what you say is true then why does the spec say this about \trrh?
Height of a table row in twips. When 0, the height is sufficient for all the text in the line; when positive, the height is guaranteed to be at least the specified height; when negative, the absolute value of the height is used, regardless of the height of the text in the line.