WinForms are not the sexiest GUI of the world in 2022 but still by far the quickest and the most powerfull to implement. And if you take time to customise the controls you can have something way more "modern look alike". So thanks you Tim for still giving us tutorials on WinForms :).
@@SpaceTimeBeing_ QT with c++ is harder to implement than winform c#, I'd personally use wpf though with avalonia for cross platform, data binding and xaml is way easier for me now than fidgeting controls in a form window, not to mention manipulating gui with xaml codes and trigger events instead of code behind, its so clean man.
@@nicholaspreston9586 Razor is just an engine that generates HTML output. But even so, these guys are discussing desktop apps, you're comparing motorcycles to airplanes. But anyway, Windows Forms has perfectly fine ways to handle itself, provided it's used correctly. I do agree there are more modern options, but realize each option is just that, an option, each trying to solve a different problem. One of the great things about windows forms is how it closely mirrors that of traditional windows GUI programming. To suggest that windows forms has no place within a large enterprise app is just silly, enterprise apps often encompass legacy systems, and the legacy systems usually exist until there is a cause for re-implementing them into something more modern, and sometimes that never happens. Believe it or not, sometimes big, monolithic green screen systems exist as part of these more modern enterprise solutions, which as you say tend to be adopting these more modern ways of doing things... Incidentally, most developers want to be working with the new and more modern, the fact that their employers pay them to maintain legacy systems doesn't inherently make them awful.
Can't express how amazing this tutorial is... thanks a lot, using winforms gives me nostalgia hits because I remember using it 15 years ago with VB as well....
I wouldn't say it is the best, but it is a good option to have. The uses for it have significantly decreased over the years, but it still has its place.
I am taking Advanced Object-Oriented Programming this semester using C#. I wish I had watched this video first. Windows Forms had been such a headache. Thank you for the great work!
Finally had time to watch and thanks for a nice video with also a few tips that I didn't know although being a WinForms developer for 2 years in a row: 1) controls inherit font and other default properties from Form 2) the alignment line when aligning by mouse is the position of text in the control This video needs a sequel with these two important best practices - using TableLayoutPanel for sizing by ratio and UserControls to modularize UI. Nice to see the naming convention of firstNameLabel which I actually adopted somehow naturally even before seeing this.
Thanks for the wonderful video! I learned quite a lot of subtle stuff in this episode! Also, if I recall correctly, the reason for allowing Tab order on labels is so that you can assign accessibility keys to the non-labelled controls. For instance a label with a tab order 3 and a text property of &First Name will give focus to a text box with a tab order of 4 when you press ALT+F. So, it's a way of setting shortcut accessibility to things like textboxes, comboboxes, listboxes, etc. via their preceding labels. (At least that's how I remember it to be.)
This is the reason why I struggle so much with JAVA in my bachelor degree. Most of my class only had a small introduction to C, for, while, variables, pointers, structures, but had never seen a form in our life. Classe was designed to teach OOP without teaching anything else. More than 70 students complained about this, the next year the classe was much better structured.
If they started you off making winforms and waited to teach you fundamentals then you'd be complaining they didn't give you a strong enough foundation.
Personally what I find with Hungarian camel case is that naming all your Labels lblFirstName and then lblLastName or tbFirstName for textbox1 first name allows you to find what you are looking for quicker in the drop down select when looking for controls. I realize the firstname example is not the best as most of us would see that as first name and look in F, but when you can't remember the naming scheme and have dozens or more controls, knowing you are looking for a button (which there might be only 2 lets say) allows you to go to btnDDD or b in the list and see only 2 very quickly rather than scroll through the entire list looking for some other naming convention. I realize the entire industry flip flops on these things all the time, but I don't find the argument that this is how you say it naturally as appealing as me finding it quickly in the drop down select on a form that is so complex (with controls hidden behind other controls for those of you who say click it directly) that it is difficult to find the name when unknown. justMyTwoCents = habit
Thanks Tim! I’ve seen code behind files with over 30k lines of code and all kinds of data access in there... you can forget about testing anything in there... if you are a developer working in windows forms, WPF, web forms, Maui or whatever technology with a code behind associated to the view, please, think about your future self and your colleagues that will come after you, and put your business logic to in a different layer!
Thanks Master, It's great to see the same topic explored from a different perspective. While there are many similarities, there are also some interesting nuances that make this approach unique.
I found a youtube tutorial on making Pong with C# and it was WinForms. It didn't take long for the magic to break, lol. I am so glad I found this video, it helped upgrade my understanding of WinForm applications. Also great advice at the end of the video, I am going to check out your class library video next. Thank you!
man this is an amazing begginers tutorial! the way you tech is great, clear and awesome! I come from PyQt5 and with this video I could understand more of desktop development! I am changing to C# and I want to start with WinForm
After 6 months of trying to get any kind of WPF application, with a resource dictionary, a menu, and two pages to work I give up and stick with win forms. Most of the tutorials are really crappy. Thank you for your tutorials on winforms. I am really happy that I could learn at least a little bit of C#
I'm learning by becoming fascinated by "the magic" and then learn how everything works. I want to know why I am learning stuff. That motivates me. I wanted to create a simple window application that also works on older systems, I came across Windows Forms, and it made me wanted extending my knowledge of C#. Had a bit of C, C++, Java, Python, Pascal at school, but I hadn't had the motivation for learning them all the years, because no one showed me the real magic. Why I started to learn HTML? I started from analyzing the developer tools in the browser, then learning all the tools that exist like frameworks, Bootstrap, Angular, etc., then how CSS works because I knew then where it is needed, and finally what is a proper template for HTML, semantics, and this kind of things.
I just finished my first week as a .NET developer in a big company. My team is maintaining a huge, complex .NET Framework 4.6.1 client application. It's not so simple to upgrade such complex solutions which has so many internal and external dependencies, to a new version of .NET.
I think you just learned a valuable lesson there. If you have a simple WinForms project in .NET Framework 4.6.1 and you want to upgrade it to .NET 8, it will take you about 2 minutes. But, as you've seen, your companies WinForms project would take a lot longer to upgrade. Why? Well, because of how well the .NET (Core) changes were made, there aren't a ton of breaking changes in the code itself. There will be some, but the list will be relatively small in most cases. The MUCH bigger issue is all of the dependencies that you took on with your application. Third-party libraries, NuGet packages, other internal projects, and more all add up to a spiderweb of messy development. They make upgrading really hard. That's why I push really hard on understanding WHEN to take on a dependency, because a little time-savings now can lead to a LOT of problems later when that dependency doesn't upgrade. Another big one is poor architecture. It happens to all of us. We start out with the best of intentions, but sometimes we forget not to take a direct dependency on something and things grow from there. If you had really clear separations between your UI layers and your logic layers and between them and your data access layers, you could upgrade the data access and business logic layers to .NET Standard 2.0. This would allow you to prepare all of your underlying code for .NET (Core) a piece at a time without being a big disruptor. Then, you could work on either writing new interfaces that called the same underlying code or you could upgrade your UIs one at a time, whichever is more efficient.
This was an amazing course I myself am a javascript developer and have been looking for a proper tutorial that will actually explains the structure of a winforms application so I can pick it up and get started on my own and this video was exactly what I needed. S good that I am going to also watch a course of yours on OOP in c# to freshen up again. Thanks ❤
You can also have shortcuts for labels. For example, have the ''F'' on First Name label. When a user presses Alt + F, the cursor moves to the next control that supports TabIndex. As for the tab index being on the label, I think Microsoft left if for consistency or it's all controls inherits the Controls class.
Great video. The tips were good especially around naming the elements "before" clicking them and the associated designer error. Always wondered about those and why they were always named the "old" way! :)
Reinnovating Windows Forms with Dependency Injection stuff is real gold stuff. The constructor in the partial class can take arguments (interfaces), just like any other class with DI. I have created an ILogger component that shows messages from the whole app, in a TextBox/Rich Textbox!
@@pavfrang I think it is impossible to use constructor injection with UserControls which are placed in Forms during design time. The reason is that they are not created by the DI system and thus cannot use the DI system unlike Forms which can be constructed using a e.g. factory which Tim Corey has shown.
@@S3Kglitches you are correct. I did not find a way to use it at Design Mode, but I really did not find why this would work there. It is supposed to use it in runtime mode only. I have done several projects with DI in Winforms, and I cannot imagine a real need to use it at Design Mode.
I have used Maui Hybrid for a job last month. It is a revolution. But if someone ask for something fast and windows OS WinForms is still the only solution for me.
Thanks for this, can't wait to watch. Sad that the designer performance is not the best due to the out-of-process nature because VS runs on NET Framework
Is there a WinForms tutorial series (written or video) that you recommend? I'm curious how to take the controls you have here (firstNameLabel, firstNameText etc.) and group them in a parent control "Client" that can be instantiated at runtime inside a scrollbar view. Thank you for the excellent lesson, Tim.
I have an offer to become part of the Engineering team at my job. But first, I need to remake my GUI that I made. I used WPF to make it, but they want it standardized to look more like their stuff. So I'll be watching and following this when I get the chance.
4 months later. I've made a total of 6 GUIs with WinForms now and I continue to improve it. I have old legacy code from previous devs and.... It's a giant spaghetti monster of a backend.
"Magic breaks" - No truer statement. You need a solid foundation before doing anything even slightly complicated with any framework or you're asking for trouble. Love WinForms for quick and dirty tools.
54:30 I remember in high-school (way back in the early 2000s), using VB to create little applications. I remember at the time a book came out about c# and I bought it. That was a long time ago. 😁
I have worked in a Hospital setting two different times. One in Materials management and most recently in patient registration. So, I thought for just the fun of it and to practice my past programming skills I would build an inventory program and or profile building page in C#...
Suggest setting TabIndex in increments of 5 or 10. Keep in mind if you have layers of controls using panels and so forth, tab order can be a pain to get right.
What if you use for example a TabIndex 3.2? I guess the property is an int, but what if we change that property to a double? Is it going from 3 to 3.2 and then 4? That might be interesting to test
Why you never mention winUI 3 ? According to Microsoft it is the new method for Windows applications which is not build on uwp. I tried it out but didn't feel like it is production ready even though Microsoft says that it is. I'm curious about your comment on WinUI3, when I search around the web everyone is just talking about the preview version like it was never released. So what's going on?
It feels more like UWP than WPF to me, but is it not sandboxed like UWP. @Tim There are almost no videos on WinUI 3, and very few code examples. How about a video on the future, instead of Winforms, which IMO should have been dead 10 years ago.
Winforms is the fastest and most effective to develop complex desktop apps. It is not dead especially with third party paid controls who have basically recreated winforms v2
I have avoided WinUI3 because it has been messy. I've dabbled in it a couple of times but have not been impressed. I'll eventually do a video on it, but I am not expecting amazing things.
@@IAmTimCorey It just came out of preview, but I think it will be the future of desktop development. Maybe not as a "Window Desktop App", but WinuUI 3 will eventually be supported by Uno, Maui, and other platforms. I am impressed with the tear out tabs!
I wish they would just redo Winforms with DirectX under the hood for GPU rendering and get rid of the CPU-bound GDI graphics. Then we could add much more attractive and modern UI controls and Winforms+ would be a real killer UI framework. The complicated XAML systems that lack a designer or even a decent preview window are just way too cumbersome and nearly require a front-end web design background to pick up. I'm interested in the Comet project for this reason because it lets you declare and initialize a MAUI UI with pure C# and no XAML complexities. XAML gets processed and used to create objects anyway, so I think it's awesome if we can cut that out of the way and streamline UI programming.
@10:00 I'm cracking up because I literally just had to restart a project. I got a bit overconfident, deleted the automatically generated code when I double clicked a control... and yup...
Hopefully this video will help. I also just started a course using WinForms that might be helpful: ruclips.net/video/FUqz2LF4BUs/видео.htmlsi=gYmMiulMrRUgMvas The first coding video will come out on Monday.
Ya know, if they made containers like a div tag where it would automatically shrink or stretch to its contents, that would fix a whole lot of UI/UX issues.
Remember that WinForms uses the CPU for rendering, though. The more you get into graphical manipulation, the worse it will run. It is definitely possible to do what you are suggesting, but it is something to be aware of.
Hello Tim. Great video as always. Do you happen to have any videos that talk about checkedlistboxes? I'm trying to figure out how to make two checkedlistboxes in two different forms interact with each other. Specifically, I need one to remove items from the other. I'm having no luck in my searches.
I just wanted to build a small data entry system for a small local hospital. I just need something to input the data and store into a database and get statistics at the end of month. Wouldn't a simple winform application suffice?
Well Tim thank you for you effort! Well I have to disagree with you with something..C# is one of the biggest programming languages. If you have to learn each and every feature of it you have a possibility of getting lost.. I think there's a minimum knowledge of c sharp you need to learn(probably until the basics of oop), after that you can start learning new technologies and even building apps without stopping your c# learning. That way you can learn new technologies and at the same time learning c# by overcoming the obstacles you will face in your apps
Hi Tim. I truly appreciate this channel and all your videos. If I am hung up on something or wanting to learn something new this is usually the first place I look. I have one question about this video in particular. As you stated I rename everything in WinForms (although I'm guilty of still using the old school naming convention prefixes btn for buttons, txt for text boxes, rdo for radio buttons, chk for checkboxes, etc.) except I do not rename labels unless I plan to reference them in the code. It seems to me to be a waste of time to rename them otherwise. Am I missing something? Is there an advantage to renaming labels even if I don't interact with them from code? Thanks again for all you do!
Here's my philosophy - don't skip steps. It is a dangerous habit that doesn't burn you until it does. You wouldn't name long-running variables var1, var2, etc. but that's what you would be doing with labels. It won't hurt you until you go to make a change to a label in the future. For instance, sometimes I bold the label when the field is selected or I change it to red when the data in the field is invalid. At that point, you would need to go back and rename every label before proceeding.
I am using winforms when i want to expose my single thread powershell scripts to regular users. For single purpose scripts, even tho they are complex, there is no need to spin up C# app.
Hey Tim, any interest in perhaps covering the new Windows Forms Out-Of-Process Designer? Such as creating custom collection editors, etc. in .NET 6+ it can be a little confusing/intimidating compared to the old .NET Framework way.
Me. Corey I have begun to learn C# and am now working my way try to suggestions app course. My question is that I have a massive legacy class project. I am looking to build a team to develop this project as it is over my head. We have customers and investors already onboard. Could we discuss our project with you. We could possibly pay a consult fee
I'm sorry, I don't do consulting anymore. I don't have the time to do everything, so I invest my time in places that will help the most people at once. That's content for this channel and the courses that I create.
What's the best way to "undo" adding a default event handler for a form component? It's kind of a nuisance to have to delete the handler code, then see the error, then dig into the autogenerated designer partial and remove the offending line. Does designer have an easy way to undo adding an event handler?
Great video! Can you make a tutorial on how to write designer logic for your custom controls? As an example: I want to write a custom TabControl. How would I create the designer logic for it so I can switch tabs within the designer? There are really no tutorials about that topic on the internet.
The C# Mastercourse lesson, at least at first. It was designed to be in a series of lessons, and teaches you as such. This is a stand-alone lesson, which will be valuable but wasn't specifically designed to be part of a larger course.
Hello Tim, I had a Window Form Project. I placed every thing in a form. it becomes a huge file hard to manage. I would like to see your example to separate not interface code to other class. Thanks
You can check out the TimCo Retail Manager playlist or the Suggestion Site playlist or the Tournament Tracker playlist to see me do this as part of a full course. If you want to see WinForms specifically, check out the Tournament Tracker playlist. In all three, though, I separate out the business logic and data access, which allows me to switch out the user interfaces later on for different ones.
I'm not quite sure what the issue is but when I go to create a new project, it says Solutions 'WinFormsDemoApp' (0 of 0) in the solutions explorer and then has a separate folder with the other files. So my form never pops up in the main editing window in design mode. I've tried uninstalling visual studio and re installing but still get the same issue.
It sounds like you aren't creating something correctly, or that you are trying to do this on a Mac or Linux machine. You can download my source code and run it as well, to see if it works on your machine.
@@IAmTimCorey I appreciate the response! I'm on windows, I was able to find a solution from stackoverflow. Turns out since I had multiple versions of visual studio there was an issue with the path directory for the dotnet sdk information. Not sure on specifics but after rearranging the environment variables, the projects started showing up in the solutions explorer like they were supposed to. Now I can complete the video alongside you!
I have an old Windows Forms application. I am looking to restyle the application. What frameworks/toolkits are available, easy to use, to style an old Windows Forms app in a modern way? @anyone
@@IAmTimCorey I did a repair and that failed to fix it so I uninstalled and reinstalled and now I have access to the toolbox items. Thanks for responding.
The use for tabindex in a label control; Say we have a form with a label and a textbox (among other controls). The label has Text = "&Name" TabIndex = 5 The textbox has TabIndex = 6 If the user presses Alt-N, focus will first try to go to the label (due to the mnemonic &N ).
I need to create a catagory list that when click show a sub cataorgy list that can be clicked. What is best way to do this? I'm using visual studios 2022 c# wpforms
If you are asking about VS Code, it does not have the ability to work with Windows Forms (or WPF, UWP, WinUI, etc.) like this (with a visual designer). You need to use full Visual Studio for that.
cool, thanks for introducing this outdated technology to the newbies, i'm already excited to see the beautiful UI that your viewers will be building (edit: check out the replies to this comment to read details about this opinion)
It sounds like you might be new to the field, or at least inexperienced in more than a limited amount of C#. Learning how to use WinForms is incredibly important. First, it is a tool to add to your toolbox. It absolutely is the right choice for certain situations even today. Sure, they aren't as prevalent as they used to be since we have other options as well. I laid out those options in the video. Second, do you know why Microsoft brought it into .NET Core and invested all of those resources to modernize it? Because it is still the most popular desktop project type for C#. Sure, not for new projects, but when you get a job, you almost never start a new project. You are almost always supporting an existing project. The WinForms project type has been around for as long as C# has been around (over two decades). That means there are a LOT of legacy projects built in Windows Forms. You should know the project type that you might be working with, even if you aren't primarily working with that type. Third, as you get more experienced as a developer (and you can be inexperienced with even two decades as a developer - experience comes from widening your gaze, not just plodding along with your head down), you will find that a good developer doesn't just chase the shiny new things. They add as many tools to their toolbox as possible so that they can pull the right tool out at the right time. That's why every answer like "what is the best desktop project type" is "it depends". It depends on the circumstances, including the platform, the goals, the timeframe, the team, the existing code, and more. As for WinForms not looking beautiful, that's the fault of the developer. You can absolutely make WinForms look amazing. However, how many companies are looking to make applications that look awesome? Usually companies are looking for applications that do the job. The primary goal is almost always functionality, since most of these applications are used internally. I worked with a customer a couple of years ago who was building a brand new WinForms application (it was the right choice for their situation). They had one form that had over 100 inputs. That isn't about being pretty; that's about getting the job done.
@@IAmTimCorey i'd rather use a .NET Core API in the Backend, then create an Angular / Ember or even plain Javascript / HTML / SASS Frontend, that makes for a very versatile and variable UI that's responsive, runs on all platforms without needing to build it specifically for that platform, it's easy to update and looks beautiful. During development, i like to run my API on my dev PC (WIN) and angular / ember inside of a docker container in WSL2, this way my os doesn't have to handle the dependencies, it's a way to run a lightweight dev environment and webserver on Linux without needing to use a VM. The Frontend docker container is proxied to the windows host system and calls the api, i can just run the api natively and develop in realtime while also making changes to the ui which is live-reloaded. i prefer web-based UIs since you can easily add very complex elements, and it's fun to use the inspect-element for drafting, it enables you to write very specific elements for very specific devices or keep everything resizable and totally generalized. But no, no, you're right, i'm a newbie, i didn't start with WinForms in 2012 and used that abomination for years before switching to WPF and later to actual modern UI technology. the actual error here is that you believe that keeping WinForms is "widening your gaze". WinForms was officially declared DEAD in 2014, them keeping that thing alive is a sunk cost fallacy at its finest. They keep it alive and are going to until the end of Win32. As for WPF, it was better, and i belive for the ease of use and styling it probably still is, but it's just a bad implementation of a good idea. You should not assume anything about the professionallity of others when all you do is repurposing the latest medium articles to use in a youtube video. it's good to know old tech - to be able to work on legacy code, but it's not good to promote it to newbies since it's just too easy, they'll learn it and, because it's easy, will refrain from learning actual UI (at least some of them, i'd even say the majority). which leads us back to my initial comment btw. the majority of people take the easy way out, showing them the worst possible but "easy" way breeds a generation of bad developers, which is fine for me since i don't need to deal with qualified competitors and i'll probably always be able to find better paying customers and/or jobs than most of my competitors, but from a generous and friendly point of view, you are destroying careers for easy youtube fame by recommending bad design and toolsets without really knowing about them. which perfectly fits my expectation of a tech youtuber pretending to know something about programming, score views, recycle others work, don't try to find sources or make your own opinion by learning about the subject, promote getting worse at your job.
Hi Corey, great video as always! Can you please answer this question or make a video on it? How the hell does inheritance work in forms? I made a pretty solid group of forms for university, and I thought I used inheritance well until it crashed. I built two completely normal forms, form1 and form2, and then changed the code in form2 to read: Partial Public Class Form2 : Form1 It worked for a while then suddenly i got an error saying Form2 couldnt find the constuctor for form1, this meant I couldnt open the designer for form2. Id really appreciate an answer, thanks
On Mac, you cannot create a Windows Forms app because they rely on Windows libraries. Same for WPF and UWP. Sorry. You would need to use a virtual machine to do that.
I find vstudio 2022 and net 6 to be buggy for WinForms. The form will frequently not display in design mode, you have to close it and reopen and sometimes completely reload the project. Hopefully this gets better over time.
Interesting. I haven't had those issues. Could it possibly be a third-party plug-in that is causing some of the issues? I know WinForms isn't as polished as it should be in .NET 6, I'm just wondering if you are also experiencing other issues that might be solvable.
@@IAmTimCorey I've never used plugins or add-ins that did not install with visual studio. I have also noticed other issues. I just continue using visual studio 2019 until it gets better because I am not sure if it is vs 2022 or net 6 or a combination. I've been writing c# winforms since net 1.0 I've never seen anything like this.
I take that back I started c# i think in net 1.1 . I used VB before but man vb sucks just too much typing and obscure language crap like event handler method signature syntactical requirements.
I am having the issue where when I am renaming the button to 'sayHelloButton' and then I double click on it to create the show text box, it is not creating the event in the MainForm.cs...is this a common issue? EDIT: this works when I do not change (name), but if I start a new project and change the names of the text box and button before anything else then when I double click the button I do not get a generated click event.
I am running a process in another class and would like to update a label or progress bar during the processing. Is it better to just pass the label or progress bar to the secondary class or are there callbacks in WinForms?
Use an event. Don't pass your controls around. That ties your code directly to that UI element and that UI type. Put an event in your class and then subscribe to it in your UI class.
WinForms are not the sexiest GUI of the world in 2022 but still by far the quickest and the most powerfull to implement. And if you take time to customise the controls you can have something way more "modern look alike". So thanks you Tim for still giving us tutorials on WinForms :).
You are welcome.
@@Personal-rc7cy is it free? All third party controls libraries I found are not.
@@thomstunes6485 no, and never used cracked ones, once its detected it will ruin all your app, and you might rewrite one.
@@SpaceTimeBeing_ QT with c++ is harder to implement than winform c#, I'd personally use wpf though with avalonia for cross platform, data binding and xaml is way easier for me now than fidgeting controls in a form window, not to mention manipulating gui with xaml codes and trigger events instead of code behind, its so clean man.
@@nicholaspreston9586 Razor is just an engine that generates HTML output. But even so, these guys are discussing desktop apps, you're comparing motorcycles to airplanes.
But anyway, Windows Forms has perfectly fine ways to handle itself, provided it's used correctly. I do agree there are more modern options, but realize each option is just that, an option, each trying to solve a different problem.
One of the great things about windows forms is how it closely mirrors that of traditional windows GUI programming.
To suggest that windows forms has no place within a large enterprise app is just silly, enterprise apps often encompass legacy systems, and the legacy systems usually exist until there is a cause for re-implementing them into something more modern, and sometimes that never happens. Believe it or not, sometimes big, monolithic green screen systems exist as part of these more modern enterprise solutions, which as you say tend to be adopting these more modern ways of doing things...
Incidentally, most developers want to be working with the new and more modern, the fact that their employers pay them to maintain legacy systems doesn't inherently make them awful.
your hour half video has taught me more about this one section than my professor has in an entire semester
Awesome!
college for developers is overrated
Second programming RUclipsr with an actual personality enjoyable to watch🎉
Thanks!
Who is first?
Can't express how amazing this tutorial is... thanks a lot, using winforms gives me nostalgia hits because I remember using it 15 years ago with VB as well....
I'm glad it was helpful.
Do not underestimate Windows forms! It’s the best way to program for Windows for last 22 years.
I wouldn't say it is the best, but it is a good option to have. The uses for it have significantly decreased over the years, but it still has its place.
I am taking Advanced Object-Oriented Programming this semester using C#. I wish I had watched this video first. Windows Forms had been such a headache. Thank you for the great work!
Glad it was helpful!
Finally had time to watch and thanks for a nice video with also a few tips that I didn't know although being a WinForms developer for 2 years in a row:
1) controls inherit font and other default properties from Form
2) the alignment line when aligning by mouse is the position of text in the control
This video needs a sequel with these two important best practices - using TableLayoutPanel for sizing by ratio and UserControls to modularize UI.
Nice to see the naming convention of firstNameLabel which I actually adopted somehow naturally even before seeing this.
Thanks for sharing.
Hello just starting out this is a great introduction and I just realized after clicking your channel that it is a goldmine. Thank you!
You are welcome. I'm glad you are finding it valuable.
Thanks for the wonderful video! I learned quite a lot of subtle stuff in this episode! Also, if I recall correctly, the reason for allowing Tab order on labels is so that you can assign accessibility keys to the non-labelled controls. For instance a label with a tab order 3 and a text property of &First Name will give focus to a text box with a tab order of 4 when you press ALT+F. So, it's a way of setting shortcut accessibility to things like textboxes, comboboxes, listboxes, etc. via their preceding labels. (At least that's how I remember it to be.)
This was extremely thorough and I appreciate your advice for novice programmers. Good video
Thanks!
This is the reason why I struggle so much with JAVA in my bachelor degree. Most of my class only had a small introduction to C, for, while, variables, pointers, structures, but had never seen a form in our life.
Classe was designed to teach OOP without teaching anything else.
More than 70 students complained about this, the next year the classe was much better structured.
If they started you off making winforms and waited to teach you fundamentals then you'd be complaining they didn't give you a strong enough foundation.
responsive design in winforms is a nightmare but it is still a good option. Thanks Tim, your effort is much appreciated. 🎉
You are welcome.
Personally what I find with Hungarian camel case is that naming all your Labels lblFirstName and then lblLastName or tbFirstName for textbox1 first name allows you to find what you are looking for quicker in the drop down select when looking for controls. I realize the firstname example is not the best as most of us would see that as first name and look in F, but when you can't remember the naming scheme and have dozens or more controls, knowing you are looking for a button (which there might be only 2 lets say) allows you to go to btnDDD or b in the list and see only 2 very quickly rather than scroll through the entire list looking for some other naming convention. I realize the entire industry flip flops on these things all the time, but I don't find the argument that this is how you say it naturally as appealing as me finding it quickly in the drop down select on a form that is so complex (with controls hidden behind other controls for those of you who say click it directly) that it is difficult to find the name when unknown. justMyTwoCents = habit
Thanks Tim! I’ve seen code behind files with over 30k lines of code and all kinds of data access in there... you can forget about testing anything in there... if you are a developer working in windows forms, WPF, web forms, Maui or whatever technology with a code behind associated to the view, please, think about your future self and your colleagues that will come after you, and put your business logic to in a different layer!
Absolutely!
Thanks Master, It's great to see the same topic explored from a different perspective. While there are many similarities, there are also some interesting nuances that make this approach unique.
You are welcome.
I found a youtube tutorial on making Pong with C# and it was WinForms. It didn't take long for the magic to break, lol. I am so glad I found this video, it helped upgrade my understanding of WinForm applications. Also great advice at the end of the video, I am going to check out your class library video next. Thank you!
I am glad it was helpful.
Hello Tim! You are a legend! I had a problem that the buttons do not work and i found here the solution. You have just earned a Sub!
Glad I could help.
When doing some research about MAUI recently, I also stumbled upon WinUI 3. I'd love to see you cover that in an upcoming video.
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
man this is an amazing begginers tutorial! the way you tech is great, clear and awesome! I come from PyQt5 and with this video I could understand more of desktop development! I am changing to C# and I want to start with WinForm
Awesome, thank you!
After 6 months of trying to get any kind of WPF application, with a resource dictionary, a menu, and two pages to work I give up and stick with win forms. Most of the tutorials are really crappy. Thank you for your tutorials on winforms. I am really happy that I could learn at least a little bit of C#
You are welcome.
amazing video i now learned hwo to use c# and now working as head developer for microsoft
I am glad it was helpful.
Referring to the event attached to a button etc. you can also right click on the event name, e.g. Click, and then select Reset.
Correct.
I'm learning by becoming fascinated by "the magic" and then learn how everything works. I want to know why I am learning stuff. That motivates me.
I wanted to create a simple window application that also works on older systems, I came across Windows Forms, and it made me wanted extending my knowledge of C#.
Had a bit of C, C++, Java, Python, Pascal at school, but I hadn't had the motivation for learning them all the years, because no one showed me the real magic.
Why I started to learn HTML? I started from analyzing the developer tools in the browser, then learning all the tools that exist like frameworks, Bootstrap, Angular, etc., then how CSS works because I knew then where it is needed, and finally what is a proper template for HTML, semantics, and this kind of things.
Thanks for sharing.
this was great answered a lot of my questions i loved the tim explains it
I am glad it was helpful.
I just finished my first week as a .NET developer in a big company. My team is maintaining a huge, complex .NET Framework 4.6.1 client application. It's not so simple to upgrade such complex solutions which has so many internal and external dependencies, to a new version of .NET.
I think you just learned a valuable lesson there. If you have a simple WinForms project in .NET Framework 4.6.1 and you want to upgrade it to .NET 8, it will take you about 2 minutes. But, as you've seen, your companies WinForms project would take a lot longer to upgrade. Why?
Well, because of how well the .NET (Core) changes were made, there aren't a ton of breaking changes in the code itself. There will be some, but the list will be relatively small in most cases. The MUCH bigger issue is all of the dependencies that you took on with your application. Third-party libraries, NuGet packages, other internal projects, and more all add up to a spiderweb of messy development. They make upgrading really hard. That's why I push really hard on understanding WHEN to take on a dependency, because a little time-savings now can lead to a LOT of problems later when that dependency doesn't upgrade.
Another big one is poor architecture. It happens to all of us. We start out with the best of intentions, but sometimes we forget not to take a direct dependency on something and things grow from there. If you had really clear separations between your UI layers and your logic layers and between them and your data access layers, you could upgrade the data access and business logic layers to .NET Standard 2.0. This would allow you to prepare all of your underlying code for .NET (Core) a piece at a time without being a big disruptor. Then, you could work on either writing new interfaces that called the same underlying code or you could upgrade your UIs one at a time, whichever is more efficient.
Hey fast learners. This is the tutorial you were looking for! Thank me later 😉
This was an amazing course I myself am a javascript developer and have been looking for a proper tutorial that will actually explains the structure of a winforms application so I can pick it up and get started on my own and this video was exactly what I needed. S good that I am going to also watch a course of yours on OOP in c# to freshen up again. Thanks ❤
You are welcome.
You can also have shortcuts for labels. For example, have the ''F'' on First Name label. When a user presses Alt + F, the cursor moves to the next control that supports TabIndex.
As for the tab index being on the label, I think Microsoft left if for consistency or it's all controls inherits the Controls class.
Thanks for sharing.
Great video. The tips were good especially around naming the elements "before" clicking them and the associated designer error. Always wondered about those and why they were always named the "old" way! :)
I am glad it was helpful.
Thank you some much I'm taking an intro to c# class and I really just needed more info on forms.
I am glad it was helpful.
Reinnovating Windows Forms with Dependency Injection stuff is real gold stuff. The constructor in the partial class can take arguments (interfaces), just like any other class with DI. I have created an ILogger component that shows messages from the whole app, in a TextBox/Rich Textbox!
DI is a great addition to almost any project. Well done.
How do you do dependency injection with constructor injection in UserControls placed into Forms during design time?
@@S3Kglitches hmm , I have not done this. I have only used DI within the Form constructors, so I suppose this works on any control too.
@@pavfrang I think it is impossible to use constructor injection with UserControls which are placed in Forms during design time. The reason is that they are not created by the DI system and thus cannot use the DI system unlike Forms which can be constructed using a e.g. factory which Tim Corey has shown.
@@S3Kglitches you are correct. I did not find a way to use it at Design Mode, but I really did not find why this would work there. It is supposed to use it in runtime mode only. I have done several projects with DI in Winforms, and I cannot imagine a real need to use it at Design Mode.
Thank you so much mr Tim.I hope you willshare more precious information with us .
You are welcome.
Thanks for your sharing sir, it helps a lot for studying.
You are welcome.
Brilliantly explained!! I learned a lot from this video.
Glad it was helpful!
What? WinForms in 2022 and in .NET 6? At first the title confused me lol! I still have to see the video tho.
Yep, it is still around and still being improved.
VB 6.0 to till now I Love Windows Forms
Great!
I have used Maui Hybrid for a job last month. It is a revolution. But if someone ask for something fast and windows OS WinForms is still the only solution for me.
Thanks for this, can't wait to watch. Sad that the designer performance is not the best due to the out-of-process nature because VS runs on NET Framework
Yeah, that is a bummer.
Good video, buttresses things I was already familiar with. Thank You Sir.
You are welcome.
Is there a WinForms tutorial series (written or video) that you recommend? I'm curious how to take the controls you have here (firstNameLabel, firstNameText etc.) and group them in a parent control "Client" that can be instantiated at runtime inside a scrollbar view. Thank you for the excellent lesson, Tim.
use UserControl as a parent for grouping into a separate component or GroupControl or Panel for grouping locally
First here to comment.
We love alk you do for the community
Thank you!
I have an offer to become part of the Engineering team at my job. But first, I need to remake my GUI that I made. I used WPF to make it, but they want it standardized to look more like their stuff. So I'll be watching and following this when I get the chance.
You can make a WPF GUI look like WinForms. That might be simpler.
4 months later.
I've made a total of 6 GUIs with WinForms now and I continue to improve it. I have old legacy code from previous devs and.... It's a giant spaghetti monster of a backend.
"Magic breaks" - No truer statement. You need a solid foundation before doing anything even slightly complicated with any framework or you're asking for trouble. Love WinForms for quick and dirty tools.
Agreed.
54:30 I remember in high-school (way back in the early 2000s), using VB to create little applications. I remember at the time a book came out about c# and I bought it. That was a long time ago. 😁
It has been a while.
haha. very good point on the digital vs paper based prototype :)
Thanks.
I have worked in a Hospital setting two different times. One in Materials management and most recently in patient registration. So, I thought for just the fun of it and to practice my past programming skills I would build an inventory program and or profile building page in C#...
Sounds good.
wow ,from Turkey ,this helpfull,thanks
I am glad it was helpful.
There were a time where the partial class is not invented (.Net 1). So Visual Studio generate InitializeComponent Region in the same class file.
Yeah, that was fun.
"If you are brand new at C#, this is not a place to start"
please email this to my teacher, sir
You can always forward it to them. I’d love to talk to them about it.
Suggest setting TabIndex in increments of 5 or 10. Keep in mind if you have layers of controls using panels and so forth, tab order can be a pain to get right.
Thanks for the suggestion.
What if you use for example a TabIndex 3.2? I guess the property is an int, but what if we change that property to a double? Is it going from 3 to 3.2 and then 4? That might be interesting to test
Why you never mention winUI 3 ? According to Microsoft it is the new method for Windows applications which is not build on uwp. I tried it out but didn't feel like it is production ready even though Microsoft says that it is. I'm curious about your comment on WinUI3, when I search around the web everyone is just talking about the preview version like it was never released. So what's going on?
He doesn't even have the Windows App SDK installed.
It feels more like UWP than WPF to me, but is it not sandboxed like UWP. @Tim There are almost no videos on WinUI 3, and very few code examples. How about a video on the future, instead of Winforms, which IMO should have been dead 10 years ago.
Winforms is the fastest and most effective to develop complex desktop apps. It is not dead especially with third party paid controls who have basically recreated winforms v2
I have avoided WinUI3 because it has been messy. I've dabbled in it a couple of times but have not been impressed. I'll eventually do a video on it, but I am not expecting amazing things.
@@IAmTimCorey It just came out of preview, but I think it will be the future of desktop development. Maybe not as a "Window Desktop App", but WinuUI 3 will eventually be supported by Uno, Maui, and other platforms. I am impressed with the tear out tabs!
I wish they would just redo Winforms with DirectX under the hood for GPU rendering and get rid of the CPU-bound GDI graphics. Then we could add much more attractive and modern UI controls and Winforms+ would be a real killer UI framework. The complicated XAML systems that lack a designer or even a decent preview window are just way too cumbersome and nearly require a front-end web design background to pick up. I'm interested in the Comet project for this reason because it lets you declare and initialize a MAUI UI with pure C# and no XAML complexities. XAML gets processed and used to create objects anyway, so I think it's awesome if we can cut that out of the way and streamline UI programming.
Hi Tim! Would be possible a video explaining winforms best practices to implement dependency injection?
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
@10:00 I'm cracking up because I literally just had to restart a project. I got a bit overconfident, deleted the automatically generated code when I double clicked a control... and yup...
Jezzz, what a great tutorial!
Thanks!
winForm is best ! next generation!
I'm glad you enjoy it.
Week2 of my college course and we're doing a project in this...I'm so beyond lost.
Hopefully this video will help. I also just started a course using WinForms that might be helpful: ruclips.net/video/FUqz2LF4BUs/видео.htmlsi=gYmMiulMrRUgMvas
The first coding video will come out on Monday.
Yes Winforms👍🏽👍🏽👍🏽, and next dependency injection in winforms
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
Ya know, if they made containers like a div tag where it would automatically shrink or stretch to its contents, that would fix a whole lot of UI/UX issues.
Remember that WinForms uses the CPU for rendering, though. The more you get into graphical manipulation, the worse it will run. It is definitely possible to do what you are suggesting, but it is something to be aware of.
for that case you have UWP or WPF
TableLayoutPanel together with control's Dock and Alignment properties are your friend
Hello Tim. Great video as always. Do you happen to have any videos that talk about checkedlistboxes? I'm trying to figure out how to make two checkedlistboxes in two different forms interact with each other. Specifically, I need one to remove items from the other. I'm having no luck in my searches.
No, sorry. My recommendation would be to tie into the events to identify when the state changes and update the other list.
@@IAmTimCorey Okay. I'll keep looking. Thanks for replying. I've been making a little progress using ChatGPT as well. 😄
LOL 10:48 is 100% me I delete project and start over, Thank you for your help
I'm glad you have a solution now.
Great video! Thank you!
You are welcome.
Great tutorial 👍
Thanks!
I just wanted to build a small data entry system for a small local hospital. I just need something to input the data and store into a database and get statistics at the end of month. Wouldn't a simple winform application suffice?
It could.
Well Tim thank you for you effort! Well I have to disagree with you with something..C# is one of the biggest programming languages. If you have to learn each and every feature of it you have a possibility of getting lost.. I think there's a minimum knowledge of c sharp you need to learn(probably until the basics of oop), after that you can start learning new technologies and even building apps without stopping your c# learning. That way you can learn new technologies and at the same time learning c# by overcoming the obstacles you will face in your apps
Can you do a WinForms with Selenium tutorial?
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
Hi Tim. I truly appreciate this channel and all your videos. If I am hung up on something or wanting to learn something new this is usually the first place I look. I have one question about this video in particular. As you stated I rename everything in WinForms (although I'm guilty of still using the old school naming convention prefixes btn for buttons, txt for text boxes, rdo for radio buttons, chk for checkboxes, etc.) except I do not rename labels unless I plan to reference them in the code. It seems to me to be a waste of time to rename them otherwise. Am I missing something? Is there an advantage to renaming labels even if I don't interact with them from code?
Thanks again for all you do!
Here's my philosophy - don't skip steps. It is a dangerous habit that doesn't burn you until it does. You wouldn't name long-running variables var1, var2, etc. but that's what you would be doing with labels. It won't hurt you until you go to make a change to a label in the future. For instance, sometimes I bold the label when the field is selected or I change it to red when the data in the field is invalid. At that point, you would need to go back and rename every label before proceeding.
@@IAmTimCorey fair point.
Great video, please do dependency injection on winforms.
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
I am using winforms when i want to expose my single thread powershell scripts to regular users. For single purpose scripts, even tho they are complex, there is no need to spin up C# app.
Great!
Hey Tim, any interest in perhaps covering the new Windows Forms Out-Of-Process Designer? Such as creating custom collection editors, etc. in .NET 6+ it can be a little confusing/intimidating compared to the old .NET Framework way.
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
Waiting for MAUI videos 🙂
They will take a bit of time. There are two out, but I want to have some time testing MAUI before I do more videos on it.
Me. Corey I have begun to learn C# and am now working my way try to suggestions app course. My question is that I have a massive legacy class project. I am looking to build a team to develop this project as it is over my head. We have customers and investors already onboard. Could we discuss our project with you. We could possibly pay a consult fee
I'm sorry, I don't do consulting anymore. I don't have the time to do everything, so I invest my time in places that will help the most people at once. That's content for this channel and the courses that I create.
What's the best way to "undo" adding a default event handler for a form component? It's kind of a nuisance to have to delete the handler code, then see the error, then dig into the autogenerated designer partial and remove the offending line.
Does designer have an easy way to undo adding an event handler?
Great video!
Can you make a tutorial on how to write designer logic for your custom controls?
As an example: I want to write a custom TabControl. How would I create the designer logic for it so I can switch tabs within the designer?
There are really no tutorials about that topic on the internet.
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
Should we follow this video or your older video in the C# Mastercourse?
The C# Mastercourse lesson, at least at first. It was designed to be in a series of lessons, and teaches you as such. This is a stand-alone lesson, which will be valuable but wasn't specifically designed to be part of a larger course.
The only issu I have with Win Forms is the use of CPU when rendering the UI.
Yep, that's a drawback, but if you want to do graphics-heavy work, WPF is a MUCH better option.
Hello Tim, I had a Window Form Project. I placed every thing in a form. it becomes a huge file hard to manage. I would like to see your example to separate not interface code to other class. Thanks
I do that in this course (free on RUclips): ruclips.net/p/PLLWMQd6PeGY3t63w-8MMIjIyYS7MsFcCi
I a couple of videos you mentioned to write the code not related to the form in a different class. Do you have an example?
You can check out the TimCo Retail Manager playlist or the Suggestion Site playlist or the Tournament Tracker playlist to see me do this as part of a full course. If you want to see WinForms specifically, check out the Tournament Tracker playlist. In all three, though, I separate out the business logic and data access, which allows me to switch out the user interfaces later on for different ones.
I'm not quite sure what the issue is but when I go to create a new project, it says Solutions 'WinFormsDemoApp' (0 of 0) in the solutions explorer and then has a separate folder with the other files. So my form never pops up in the main editing window in design mode. I've tried uninstalling visual studio and re installing but still get the same issue.
It sounds like you aren't creating something correctly, or that you are trying to do this on a Mac or Linux machine. You can download my source code and run it as well, to see if it works on your machine.
@@IAmTimCorey I appreciate the response! I'm on windows, I was able to find a solution from stackoverflow. Turns out since I had multiple versions of visual studio there was an issue with the path directory for the dotnet sdk information. Not sure on specifics but after rearranging the environment variables, the projects started showing up in the solutions explorer like they were supposed to. Now I can complete the video alongside you!
Should I learn WPF or winforms?
Learn C# well. Then learn both to the level that you can build applications in them. Then go deeper in the one that you are employed to use.
I have an old Windows Forms application. I am looking to restyle the application. What frameworks/toolkits are available, easy to use, to style an old Windows Forms app in a modern way? @anyone
WinForms are the best way to learn C# shortly after console apps in my opinion
It is a nice, easy step up from Console once you understand OOP. Easier than WPF.
All the Toolbox selections are grayed out. :(
You have to be on a form designer to get access to the toolbox items.
@@IAmTimCorey I think I am, of course I have no idea what I'm doing though. :)
@@IAmTimCorey I did a repair and that failed to fix it so I uninstalled and reinstalled and now I have access to the toolbox items. Thanks for responding.
The use for tabindex in a label control;
Say we have a form with a label and a textbox (among other controls).
The label has
Text = "&Name"
TabIndex = 5
The textbox has
TabIndex = 6
If the user presses Alt-N, focus will first try to go to the label (due to
the mnemonic &N ).
Ah, good to know.
Why you needed to restart, didnt we had task manager at that time?
I need to create a catagory list that when click show a sub cataorgy list that can be clicked. What is best way to do this? I'm using visual studios 2022 c# wpforms
Can you make a video on Intro to WinUI 3 in .NET 6? I am having problems with converting .NET 5 to .NET 6 in my WinUI 3 app
How do you get that home page in VSC? I couldn't even start the video
If you are asking about VS Code, it does not have the ability to work with Windows Forms (or WPF, UWP, WinUI, etc.) like this (with a visual designer). You need to use full Visual Studio for that.
cool, thanks for introducing this outdated technology to the newbies, i'm already excited to see the beautiful UI that your viewers will be building (edit: check out the replies to this comment to read details about this opinion)
It sounds like you might be new to the field, or at least inexperienced in more than a limited amount of C#. Learning how to use WinForms is incredibly important. First, it is a tool to add to your toolbox. It absolutely is the right choice for certain situations even today. Sure, they aren't as prevalent as they used to be since we have other options as well. I laid out those options in the video.
Second, do you know why Microsoft brought it into .NET Core and invested all of those resources to modernize it? Because it is still the most popular desktop project type for C#. Sure, not for new projects, but when you get a job, you almost never start a new project. You are almost always supporting an existing project. The WinForms project type has been around for as long as C# has been around (over two decades). That means there are a LOT of legacy projects built in Windows Forms. You should know the project type that you might be working with, even if you aren't primarily working with that type.
Third, as you get more experienced as a developer (and you can be inexperienced with even two decades as a developer - experience comes from widening your gaze, not just plodding along with your head down), you will find that a good developer doesn't just chase the shiny new things. They add as many tools to their toolbox as possible so that they can pull the right tool out at the right time. That's why every answer like "what is the best desktop project type" is "it depends". It depends on the circumstances, including the platform, the goals, the timeframe, the team, the existing code, and more.
As for WinForms not looking beautiful, that's the fault of the developer. You can absolutely make WinForms look amazing. However, how many companies are looking to make applications that look awesome? Usually companies are looking for applications that do the job. The primary goal is almost always functionality, since most of these applications are used internally. I worked with a customer a couple of years ago who was building a brand new WinForms application (it was the right choice for their situation). They had one form that had over 100 inputs. That isn't about being pretty; that's about getting the job done.
@@IAmTimCorey i'd rather use a .NET Core API in the Backend, then create an Angular / Ember or even plain Javascript / HTML / SASS Frontend, that makes for a very versatile and variable UI that's responsive, runs on all platforms without needing to build it specifically for that platform, it's easy to update and looks beautiful.
During development, i like to run my API on my dev PC (WIN) and angular / ember inside of a docker container in WSL2, this way my os doesn't have to handle the dependencies, it's a way to run a lightweight dev environment and webserver on Linux without needing to use a VM.
The Frontend docker container is proxied to the windows host system and calls the api, i can just run the api natively and develop in realtime while also making changes to the ui which is live-reloaded.
i prefer web-based UIs since you can easily add very complex elements, and it's fun to use the inspect-element for drafting, it enables you to write very specific elements for very specific devices or keep everything resizable and totally generalized.
But no, no, you're right, i'm a newbie, i didn't start with WinForms in 2012 and used that abomination for years before switching to WPF and later to actual modern UI technology.
the actual error here is that you believe that keeping WinForms is "widening your gaze". WinForms was officially declared DEAD in 2014, them keeping that thing alive is a sunk cost fallacy at its finest. They keep it alive and are going to until the end of Win32.
As for WPF, it was better, and i belive for the ease of use and styling it probably still is, but it's just a bad implementation of a good idea.
You should not assume anything about the professionallity of others when all you do is repurposing the latest medium articles to use in a youtube video.
it's good to know old tech - to be able to work on legacy code, but it's not good to promote it to newbies since it's just too easy, they'll learn it and, because it's easy, will refrain from learning actual UI (at least some of them, i'd even say the majority).
which leads us back to my initial comment btw.
the majority of people take the easy way out, showing them the worst possible but "easy" way breeds a generation of bad developers, which is fine for me since i don't need to deal with qualified competitors and i'll probably always be able to find better paying customers and/or jobs than most of my competitors, but from a generous and friendly point of view, you are destroying careers for easy youtube fame by recommending bad design and toolsets without really knowing about them.
which perfectly fits my expectation of a tech youtuber pretending to know something about programming, score views, recycle others work, don't try to find sources or make your own opinion by learning about the subject, promote getting worse at your job.
Hi Corey, great video as always! Can you please answer this question or make a video on it?
How the hell does inheritance work in forms? I made a pretty solid group of forms for university, and I thought I used inheritance well until it crashed.
I built two completely normal forms, form1 and form2, and then changed the code in form2 to read:
Partial Public Class Form2 : Form1
It worked for a while then suddenly i got an error saying Form2 couldnt find the constuctor for form1, this meant I couldnt open the designer for form2.
Id really appreciate an answer, thanks
how to create windows forms app in vs 2022..?? can't find windows forms app.. pls help me
I'm using Mac.. it's looks different
On Mac, you cannot create a Windows Forms app because they rely on Windows libraries. Same for WPF and UWP. Sorry. You would need to use a virtual machine to do that.
thanks
You are welcome.
Super!!
Thanks!
cool video)
Thanks!
I find vstudio 2022 and net 6 to be buggy for WinForms. The form will frequently not display in design mode, you have to close it and reopen and sometimes completely reload the project. Hopefully this gets better over time.
Interesting. I haven't had those issues. Could it possibly be a third-party plug-in that is causing some of the issues? I know WinForms isn't as polished as it should be in .NET 6, I'm just wondering if you are also experiencing other issues that might be solvable.
@@IAmTimCorey I've never used plugins or add-ins that did not install with visual studio. I have also noticed other issues. I just continue using visual studio 2019 until it gets better because I am not sure if it is vs 2022 or net 6 or a combination. I've been writing c# winforms since net 1.0 I've never seen anything like this.
I take that back I started c# i think in net 1.1 . I used VB before but man vb sucks just too much typing and obscure language crap like event handler method signature syntactical requirements.
10:20
"The form broke"
Yhea u dont have to tell me.
I broke myself a couple times to XD
Send an engineer asap
When I run my windows forms, it just flashes and nothing happens.
Sounds like you have a configuration setting incorrect somewhere.
I am having the issue where when I am renaming the button to 'sayHelloButton' and then I double click on it to create the show text box, it is not creating the event in the MainForm.cs...is this a common issue? EDIT: this works when I do not change (name), but if I start a new project and change the names of the text box and button before anything else then when I double click the button I do not get a generated click event.
I’ve not seen that before. You can add the event using the event list instead.
I am running a process in another class and would like to update a label or progress bar during the processing. Is it better to just pass the label or progress bar to the secondary class or are there callbacks in WinForms?
Use an event. Don't pass your controls around. That ties your code directly to that UI element and that UI type. Put an event in your class and then subscribe to it in your UI class.
Hello I love your video. Is there any way I can download the whole solution to play with
There's a link in the description to download it.