question

ts-8004 avatar image
0 Votes"
ts-8004 asked TianyuSun-MSFT commented

C language edit window syntax colouring

I need code to provide syntax colouring in the C language in an edit box. Currently I use syntax colouring code which was last updated 20 years ago.

The environment is Visual C++ under MS Windows, targeting 64 bit Win 7/8/10.

What's on the market now? Is there some other forum where I should ask this question?

Thanks for answers.

c++vs-general
· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Are you asking for a tool to change the syntax coloring in Visual Studio? Or are you asking for a tool to change the syntax coloring in Visual Studio Code? Or are you asking how to show coloring in some other application? If so then is that other application a web browser (HTML)?

I assume this is not for syntax coloring in Visual Studio or Visual Studio Code. If it is for HTML then I think there are extensions in Visual Studio that could help. If for some other application then I think the question is outside the scope of these forums; there are many other forums for discussing the C and C++ languages.

0 Votes 0 ·

I have a Windows application which edits C source code in an edit box. I need the C code in the edit box to be coloured for syntax.

The application is not a web browser. It's a win 32 app written some time ago, which I am considering updating.

If this is the wrong forum to ask the question, can you name a few forums which would be more appropriate? This would be more helpful than my trying to google for results.

Thanks.

0 Votes 0 ·

That is how I would find any suggestion; I would Google myself. I Google many times a day.

0 Votes 0 ·

Hi @ts-8004 , welcome to Microsoft Q&A forum. For C++, in Visual Studio, some colors can be changed, for example:

105259-image.png

If you need more powerful coloring effect, perhaps you need to consider installing other extensions or other editors/IDE.

0 Votes 0 ·
image.png (63.8 KiB)

I don't want to change colours in Visual C++. I want to change colours in an application created by Visual C++.

I think scintilla is what I need. Thank you for you answer.

0 Votes 0 ·

@ts-8004 Since you think Scintilla meets your needs I will change my comment to an Answer.

0 Votes 0 ·

You can just use a RichEdit control or embed any WPF controls...

0 Votes 0 ·
Show more comments
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered

Hi @ts-8004 ,

the current version of Visual Studio is 2019.
Visual Studio 2022 is announced:
https://devblogs.microsoft.com/visualstudio/visual-studio-2022/
https://docs.microsoft.com/en-us/visualstudio/productinfo/vs-roadmap


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ts-8004 avatar image
0 Votes"
ts-8004 answered TianyuSun-MSFT commented

Please unset "accept answer" for this thread.

According to; https://visualstudio.microsoft.com/

the latest version is; Visual Studio 2019 & Desktop C++

Is that right? I have "Visual Studio 2019" installed on my Windows computer. So there is no more recent version?

Thank you for your answer.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ts-8004 , VS 2022 preview version(latest version currently) is currently available, please check here: Visual Studio 2022 Preview. The C++ workload will be included in the VS if you choose to install it.

0 Votes 0 ·
RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered

I dont know if this meets your needs, but the popular Notepad++ application uses Scintilla which provides code editing support including syntax highlighting.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.