{"id":232,"date":"2023-06-04T01:57:12","date_gmt":"2023-06-04T01:57:12","guid":{"rendered":"http:\/\/devphilosopher.com\/?p=232"},"modified":"2023-06-04T01:58:37","modified_gmt":"2023-06-04T01:58:37","slug":"how-to-build-a-winforms-application","status":"publish","type":"post","link":"https:\/\/devphilosopher.com\/index.php\/2023\/06\/04\/how-to-build-a-winforms-application\/","title":{"rendered":"How to Build a WinForms Application"},"content":{"rendered":"\n<p>From the perspective of a new guy<\/p>\n\n\n\n<h1 class=\"wp-block-heading has-text-align-center\">Introduction<\/h1>\n\n\n\n<p>Building in WinForms was quite an experience. I helped create a clone of MS paint from scratch with my team members using WinForms, .NET, and C#. We coded in Visual Studio using GitHub, a UML creator, and testing tools integrated into the software. The WinForms systems were fast and effective in creating UI elements for our project to leverage and draw in and today, I want to tell you how to start building in WinForms right now.<\/p>\n\n\n\n<h1 class=\"wp-block-heading has-text-align-center\">Build Walkthrough<\/h1>\n\n\n\n<p>Before we begin, this discussion\/tutorial uses Visual Studio, if you aren\u2019t using it this article won\u2019t precisely help but I may write one in the future depending on if I decide to use WinForms in the future for more school or personal projects.<\/p>\n\n\n\n<p>Let\u2019s get started:<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>Run visual studio<\/li>\n\n\n\n<li>Select \u201ccreate a new project\u201d<img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"559\" class=\"wp-image-233\" style=\"width: 500px;\" src=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-10-40.png\" alt=\"\" srcset=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-10-40.png 366w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-10-40-268x300.png 268w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/li>\n\n\n\n<li>Have \u201cC#\u201d as your selected language and project type as \u201cDesktop\u201d<img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"217\" class=\"wp-image-234\" style=\"width: 800px;\" src=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-11-16.png\" alt=\"\" srcset=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-11-16.png 1083w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-11-16-300x81.png 300w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-11-16-1024x278.png 1024w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-11-16-768x208.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>Near the top should be \u201cWindows Forms App (.NET Framework)\u201d<\/li>\n<\/ol>\n\n\n\n<p>If you don\u2019t see that option, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>Press Windows key<\/li>\n\n\n\n<li>Type \u201cvisual studio installer\u201d<\/li>\n\n\n\n<li>Click the icon that appears<\/li>\n\n\n\n<li>Click \u201cmodify\u201d on the version of VS you have<img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" class=\"wp-image-235\" style=\"width: 800px;\" src=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-12-47.png\" alt=\"\" srcset=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-12-47.png 1280w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-12-47-300x169.png 300w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-12-47-1024x576.png 1024w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-12-47-768x432.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>Under Desktop and Mobile options, you will see .NET desktop environment, select this option<\/li>\n<\/ol>\n\n\n\n<p>Now, return to step one in the previous paragraph.<\/p>\n\n\n\n<p>Resuming:<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>Name your project how you like\n<ul class=\"wp-block-list\">\n<li><span style=\"background-color: transparent; color: var(--theme-text-color); font-family: var(--fontFamily); font-size: var(--fontSize); font-style: var(--fontStyle, inherit); font-weight: var(--fontWeight); letter-spacing: var(--letterSpacing); text-transform: var(--textTransform);\">Set location to where you need it\/want it<\/span><\/li>\n\n\n\n<li>Leave framework as the default<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>You will now see a preview page that shows what the blank default app will look like when running. Let\u2019s add a button that displays text.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>We need to add the toolbox, click \u201cview\u201d in the upper left Windows bar, then click \u201cToolbox\u201d about halfway down<img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1107\" class=\"wp-image-236\" style=\"width: 1920px;\" src=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-27-00.png\" alt=\"\" srcset=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-27-00.png 2498w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-27-00-300x173.png 300w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-27-00-1024x590.png 1024w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-27-00-768x443.png 768w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-27-00-1536x885.png 1536w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-27-00-2048x1181.png 2048w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/li>\n\n\n\n<li>Now, drag and drop &#8220;button&#8221; under common tools onto the Form1.cs [design] window you see, where doesn\u2019t matter<\/li>\n\n\n\n<li>Next click it so that we are sure the properties panel in the bottom right is focused on the button<\/li>\n\n\n\n<li>Click the lightning bolt at the top of the properties panel to access the actions the button can activate in response to<img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"15\" class=\"wp-image-238\" style=\"width: 1080px;\" src=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-29-02.png\" alt=\"\" srcset=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-29-02.png 2227w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-29-02-300x4.png 300w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-29-02-1024x14.png 1024w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-29-02-768x11.png 768w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-29-02-1536x21.png 1536w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-29-02-2048x29.png 2048w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/li>\n\n\n\n<li>Under \u201cAction\u201d select \u201cClick\u201d, you may need to double click, you can rename this button in the text field now populated<\/li>\n\n\n\n<li>In form1.cs, you will now see button1_Click(), add the following line: button1.Text = \u201cHello World\u201d;<img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"623\" class=\"wp-image-239\" style=\"width: 1080px;\" src=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-30-55.png\" alt=\"\" srcset=\"https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-30-55.png 2498w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-30-55-300x173.png 300w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-30-55-1024x590.png 1024w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-30-55-768x443.png 768w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-30-55-1536x885.png 1536w, https:\/\/devphilosopher.com\/wp-content\/uploads\/2023\/06\/2023-06-03_18-30-55-2048x1181.png 2048w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/li>\n\n\n\n<li>Now press the start button in the top tool bar of VS and click the button<\/li>\n<\/ol>\n\n\n\n<h1 class=\"wp-block-heading has-text-align-center\">Conclusion<\/h1>\n\n\n\n<p>Creating projects with WinForms is simple and fast, you can rapidly modify and add UI elements to have the form and function you need for your projects. In future examples, I will be expanding upon the basics with more intricate code than \u201cprint hello world to a button field\u201d. Thanks for reading, more code to come!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From the perspective of a new guy Introduction Building in WinForms was quite an experience. I helped create a clone of MS paint from scratch with my team members using WinForms, .NET, and C#. We coded in Visual Studio using GitHub, a UML creator, and testing tools integrated into the software. The WinForms systems were [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":233,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[6,3],"tags":[22,15,23,21],"class_list":["post-232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learning-to-code","category-software","tag-desktop","tag-images","tag-windows","tag-winforms"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/comments?post=232"}],"version-history":[{"count":1,"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/posts\/232\/revisions"}],"predecessor-version":[{"id":240,"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/posts\/232\/revisions\/240"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/media\/233"}],"wp:attachment":[{"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/media?parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/categories?post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devphilosopher.com\/index.php\/wp-json\/wp\/v2\/tags?post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}