Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textwidth in Richedit

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi!

I wanted have a Textwidth of a Line of Richedit.
this code may useful:

Canvas.Textwidth(RichEdit1.Lines[0])

but when I have a formated text in my richedit this Code not works, So I tried this Code :

Canvas.Font.Assign(RichEdit1.SelAttribute);
Canvas.Textwidth(Richedit1.Lines[0]);

but when I have 2 or more fonts and sizes and styles in my Lines this code doesn't work too.

please help me that what I must do?

Thank you
Hooman
 
Have you tried to sum the widths for every character in the string ?
(Hey, this was posted a month ago...maybe the problem is already solved)
Raz (just trying to be useful)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top