berg96
berg96

Reputation: 493

Is it possible to make the design of a C# application with CSS

I am better in creating a computer based application in C# than a webpage in ASP.net. But the power that CSS has in designing buttons, form, etc.. really makes me love it.

I was searching on google if I can use just CSS in a software but no result yet. Is it possible? I know this is too abroad and kinda stupid question, but I really need an answer.

EDIT: I would like to mention that I use Visual Studio Community 2015.

Upvotes: 6

Views: 7527

Answers (3)

Green Falcon
Green Falcon

Reputation: 836

Yes you can. Use WebBroswer Class (find it in toolbox) and use your HTML and CSS codes inside that but be aware that after making all html and css strings put them in the appropriate property of the WebBrowser control. Also notice that non of server side functionalities will work. Just simple html and css.


Advice:
Learn how to use WPF instead of HTML and CSS for which has great power designing client side applications.

Upvotes: 5

Win
Win

Reputation: 62260

If you really love CSS and like to create Desktop Application using CSS, you might want to look at Electron.

Electron is an open-source framework developed by GitHub. Visual Studio Code and Atom Text Editor are created using Electron.

You cannot use C#, but you can use Typescript which is very closed to C#.

Upvotes: 3

Xander Luciano
Xander Luciano

Reputation: 3893

Yes, I would recommend using CEFSharp which is a .NET wrapper for Chromium Embedded Framework instead of the webbrowser class. You can create programs like this:

CEF inside Winforms

Which is fully responsive, and allows javascript to C# and vice versa function calls. While not the most efficient way, it does provide a great starting foundation for using web apps in a standalone method.

Upvotes: 2

Related Questions