Script for the functionality of Code Sample
I just want to have the functionality of Code Sample(this is a button above text format box in SOF when we ask a question) which is also there in StackOverFlow. How to get the color of keywords which are shown in IDE.
<pre><code>
works good to show the code but how to display the exact color which IDE is displaying, that is what I don't know. Can we have开发者_JAVA百科 same functionality in Windows form to display the code.
You might want something like this: http://code.google.com/p/syntaxhighlighter/
If you're using jQuery, then: http://code.google.com/p/jquery-chili-js/
I think you are asking for a code syntax highlighting tool in - if so check out
- http://alexgorbatchev.com/SyntaxHighlighter/
- http://colorcode.codeplex.com/
You did not specify a language though.
StackOverflow uses Google Prettify according to this post: https://meta.stackexchange.com/questions/14664/how-does-so-syntax-highlight-citations-so-well
精彩评论