.NET Core的Windows Form 也有介面設計工具

Edward Kuo
Jun 13 · 3 min read
Image for post
Image for post

.NET Core 3.X以上可以開始支援Windows Form的開發,是非常好的消息,雖然,在Web當道世界下,還是有很多情境必須使用Windows Form程式的,不過,初期用.NET Core開發Windows Form是相當累人的,因為,完全沒有是視覺化的介面可以設計Windows Form的控制元件要怎樣擺放在畫面上,只透過Code方式去定義和想像是非常累人,這樣會讓人還不如使用.NET Framework來開發Windows Form好了

但是,到了Visual Studio 16.6.2版本後,則在Visual Studio內就可以用視覺化工具設計你的.NET Core Windows Form了,不過,Visual Studio Core則沒有

Image for post
Image for post

建立.NET Core的Windows Form

打開Visual Studio選取Windows Forms APP (.NET Core)專案範本

這樣就可以建立一個Windows Form專案

Image for post
Image for post

這之前如果看到Form1.cs打開後,基本上就只能看到程式碼,不過,在新版本下,就可以如下面這樣熟悉的介面

Image for post
Image for post

這樣設計就有"畫面"可以看,連旁邊的Tool Box也準備好了,而針對每個Tool Box Controller也可以設定它的屬性

Image for post
Image for post

和每個元件的事件

Image for post
Image for post

整體開發體驗上基本上跟用.NET Framework是差不多的,不過,基於底層不同,所以有些第三方元件控制項,如果沒有支援.NET Core還是無法掛到這邊來用。

而藉由這方式,要把手邊或是未來要開發的系統都轉向.NET Core的門檻就會更少,理由也會更少了

EK.Technology Learn

Design,Thinking,Coding & have fun every thing

Edward Kuo

Written by

Enterprise IT Manager / Microsoft Regional Director / Microsoft MVP / DevOps Expert / Speaker, About me: https://profile.edwardkuo.dev/about/

EK.Technology Learn

Design,Thinking,Coding & have fun every thing

Edward Kuo

Written by

Enterprise IT Manager / Microsoft Regional Director / Microsoft MVP / DevOps Expert / Speaker, About me: https://profile.edwardkuo.dev/about/

EK.Technology Learn

Design,Thinking,Coding & have fun every thing

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store