Click here to Skip to main content
15,885,537 members
Home / Discussions / C#
   

C#

 
QuestionBest method for syntax highlighting Pin
WebMaster14-Jul-09 6:36
WebMaster14-Jul-09 6:36 
AnswerRe: Best method for syntax highlighting Pin
Luc Pattyn14-Jul-09 7:31
sitebuilderLuc Pattyn14-Jul-09 7:31 
GeneralRe: Best method for syntax highlighting [modified] Pin
WebMaster14-Jul-09 8:45
WebMaster14-Jul-09 8:45 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn14-Jul-09 15:19
sitebuilderLuc Pattyn14-Jul-09 15:19 
GeneralRe: Best method for syntax highlighting Pin
WebMaster14-Jul-09 20:47
WebMaster14-Jul-09 20:47 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 0:03
sitebuilderLuc Pattyn15-Jul-09 0:03 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 1:24
WebMaster15-Jul-09 1:24 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 1:43
sitebuilderLuc Pattyn15-Jul-09 1:43 
No, I don't do chat, twitter, and the like.

IIRC monospaced fonts such as Courier New always have integral character widths; so what I probably do is int charwidth=(int)(0.5+Graphics.MeasureString(someLongString).Width/someLongString.Length); once, then use that charwidth to map column numbers to/from pixel numbers.

If the above were incorrect, changing the fontsize slightly would be sufficient to make it hold true.
BTW: for proportional fonts things are much more complex, since then you have to really convert each and every position on its own merits.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 1:56
WebMaster15-Jul-09 1:56 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 2:03
sitebuilderLuc Pattyn15-Jul-09 2:03 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 2:33
WebMaster15-Jul-09 2:33 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 2:44
sitebuilderLuc Pattyn15-Jul-09 2:44 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 3:23
WebMaster15-Jul-09 3:23 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 3:29
sitebuilderLuc Pattyn15-Jul-09 3:29 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 4:05
WebMaster15-Jul-09 4:05 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 4:20
sitebuilderLuc Pattyn15-Jul-09 4:20 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 4:44
WebMaster15-Jul-09 4:44 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 5:16
sitebuilderLuc Pattyn15-Jul-09 5:16 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 6:11
WebMaster15-Jul-09 6:11 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 6:23
sitebuilderLuc Pattyn15-Jul-09 6:23 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 6:37
WebMaster15-Jul-09 6:37 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 6:43
sitebuilderLuc Pattyn15-Jul-09 6:43 
GeneralRe: Best method for syntax highlighting Pin
WebMaster15-Jul-09 8:34
WebMaster15-Jul-09 8:34 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn15-Jul-09 8:40
sitebuilderLuc Pattyn15-Jul-09 8:40 
GeneralRe: Best method for syntax highlighting Pin
WebMaster16-Jul-09 6:12
WebMaster16-Jul-09 6:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.