If you want to include screen dump text/code in the post, you can utilize the insert code component in the Rich Text editor.
It will include the highlighted code like this:
. Your code goes here... . . UgSession::initialize ( ) // Your Open C++ code here UgSession::terminate ( ) . . .
Actually, you can copy/paste code from Visual Studio
directly into the Rich Text window, because Vis Studio places RTF on the Clipboard when you do a Cut or Copy. Pasting messes up the spaces, but it preserves colors and font, which is nice.
Dim d, x, y As Double
Dim pt As NX.Point
Dim nU = 100
Dim nV = 70
Dim pts(nU, nV) As Position
Also, as far as I can see, code that you write in the special "Insert Code" window just gets sandwiched between <pre> and </pre> tags, so you could easily just type this HTML yourself, if you wanted.
Maybe I was a little to quick with my kudo
I couldn't reproduce the behaviour @Yamada describes.
I tried Visual Studio 2010 Professional, Visual Studio 2015 Express and various methods in Notepad++ (found in Menu -> Plugins -> NppExport) to copy RTF/formatted Text into the forum's editor using Firefox, Internet Explorer and Chrome.
The most I got was the pasted text being wrapped in a <pre>-section automatically. Often the formatted text wouldn't even show up in the editor at all (though pasting to e.g. Word worked fine with preserved formatting).
Is there still a way to get syntax highlighted code in the forum? Or will it boil down to manually editing the HTML?
Would be really cool to have some kind of shortcut to paste formatted/highlighted code!
Sorry, @Yamada, I think I worded my reply a bit wrong. I did not at all mean to imply that your post was wrong. It was just a funny moment, when I read your post, thought "great tip, finally!", kudoed you, and then it didn't work
I suppose, that the feature propably has been removed during some redesign process (as the screenshots in the first post are outdated, too). Hopefully this gets another update, soon
I just verified that text copied from VS 2017 and pasted into the Rich Text field using IE 11 preserves the colors and font:
Public Sub Main(ByVal args As String())
Dim thePDF As String = "Z:\IR\8966616\dir with spaces\webstera_toycar_assy.pdf"
' the %22s in the line below put double quotes around the file path
Shell("cmd /c %22" & thePDF & "%22")
Text copied in using Firefox, Chrome and Opera did not.