RTF Re-sizing for Rich Text Box in VB.
How do i get to know the exact RTF text height in an RTF so that i can set the RTF height correctly.
Requirement:
I need to resize the rtf depending on the text that is entered in the rich text box or inserted onto the rtf directly from the DB. The purpose of the rtf is to provide the user of a editor, where the user can use all the text formatting features. So i need to resize the correctly, so that no extra lines are visible to the user.
I would be very very greatfull to all those who can help me on this issue as i am in a very desperate situation.
pls e-mail if u need more description.
Thanks
Bimlesh
Re: RTF Re-sizing for Rich Text Box in VB.
Hi
Do you mean that you want to display all of the text in the RTF control (i.e. no scrollbars are visible), or just to limit the display so that no partial lines are displayed ?
The first option is quite simple (depending on the number of lines obviously), the second option is a little more complex.
Regards
Chris Eastwood
Software Engineer
ACNielsen Ltd
CodeGuru - the website for developers
http://www.codeguru.com
Re: RTF Re-sizing for Rich Text Box in VB.
Hi,
Thank you for the response. Actually i need to use both the above mentioned ways. There should be no Scrollbars on the RTF and no partial lines visible in UI. I need to re-size the RTF exactly to the no of lines of the text.
Problems that are being faced:
If a portion of a text is a continous text (which exeeds the width) and is inserted to the RTF, then the RTF wraps the text to fit into the RTF.In such a case, I am unable to obtain the correct height as the TEXTHEIGHT() function returns the height for one line, even though in the UI I can see 2 lines of text. NOTE: This text is continous text with no carriage return.
But TEXTHEIGHT() returns correct values, if the text contains some carriage returns.
Hope I am clear in putting up my problem.
Thanks in advance once again !
Bimlesh
mail me at !
[email protected]