Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / March 2006

Tip: Looking for answers? Try searching our database.

Using RichEditControl and getting text position in Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark E Mark - 30 Mar 2006 12:39 GMT
Hi Everyone,

I would like to use the RichEditControl for a project where I have a
set amount of rows to display the content and set width as well.

I was wondering if anyone has figured out how to find out what line a
line of text is on (assuming the text is wrapped around and the user
has not pressed enter)?

So if I had a width of 200 pixels I would like to know how which
characters are on each line after they have been typed in... Due to
Kerning of the font being used I cannot just do a simple
calculation....

Any ideas?

Thanks in Advance,

Mark
Kevin Spencer - 30 Mar 2006 13:35 GMT
Use the Graphics.MeasureString method to measure the text. See:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemdrawinggraphicsclassmeasurestringtopic.asp


Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

> Hi Everyone,
>
[quoted text clipped - 15 lines]
>
> Mark
Mark E Mark - 30 Mar 2006 14:29 GMT
Thanks Kevin,

I have used that in the past, for different applications.

Would you know by any chance how to set the tab size to be 45 pixels on
the same RichEditcontrol?

Regards

Mark
Kevin Spencer - 30 Mar 2006 18:09 GMT
Tab size? AFAIK, the RichEditControl doesn't have any tabs. You *are*
talking about the MFC Windows API RichEditControl, right?

Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

> Thanks Kevin,
>
[quoted text clipped - 6 lines]
>
> Mark

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.