Intro to Windows Forms (WinForms) in .NET 6

  Рет қаралды 212,888

IAmTimCorey

IAmTimCorey

Жыл бұрын

Windows Forms, also known as WinForms, is one of the original project types in .NET. It is designed to be a rapid application development environment for desktop applications. Over the past twenty years, other desktop application types such as WPF, UWP, and now .NET MAUI have come along. So, when would we use WinForms? In this video, I am going to show you what WinForms is, how to build it, what the best practices are, how to avoid some common pitfalls, and when you should use the WinForms project type. This project type still has value, even though we have other, shinier tools in our toolbox.
Full Training Courses: IAmTimCorey.com
Source Code: leadmagnets.app/?Resource=Int...
Mailing List: signup.iamtimcorey.com/

Пікірлер: 344
@thomstunes6485
@thomstunes6485 Жыл бұрын
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 :).
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@Personal-rc7cy
@Personal-rc7cy Жыл бұрын
I use Guna UI for modern controls in winforms
@thomstunes6485
@thomstunes6485 Жыл бұрын
@@Personal-rc7cy is it free? All third party controls libraries I found are not.
@exogendesign4582
@exogendesign4582 Жыл бұрын
@@thomstunes6485 no, and never used cracked ones, once its detected it will ruin all your app, and you might rewrite one.
@SpaceTimeBeing_
@SpaceTimeBeing_ Жыл бұрын
I don't know man, QT seems to be great too. It also works on Linux well
@charlespotokar2375
@charlespotokar2375 Жыл бұрын
your hour half video has taught me more about this one section than my professor has in an entire semester
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Awesome!
@dougfunk01
@dougfunk01 Жыл бұрын
college for developers is overrated
@timyoung6495
@timyoung6495 Жыл бұрын
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.)
@S3Kglitches
@S3Kglitches Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks for sharing.
@Skygormo
@Skygormo Жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Glad it was helpful!
@sylvestrestalin
@sylvestrestalin Жыл бұрын
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 ❤
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@VitaliChuzha
@VitaliChuzha Жыл бұрын
Do not underestimate Windows forms! It’s the best way to program for Windows for last 22 years.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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.
@megakyle83
@megakyle83 Жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I am glad it was helpful.
@dontnowatimdoing446
@dontnowatimdoing446 Ай бұрын
Hello just starting out this is a great introduction and I just realized after clicking your channel that it is a goldmine. Thank you!
@IAmTimCorey
@IAmTimCorey Ай бұрын
You are welcome. I'm glad you are finding it valuable.
@OpenZipper
@OpenZipper Жыл бұрын
Second programming KZbinr with an actual personality enjoyable to watch🎉
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks!
@VictorPraizTech
@VictorPraizTech 2 ай бұрын
Who is first?
@infinite_monkey590
@infinite_monkey590 Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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/
@andergarcia1115
@andergarcia1115 6 ай бұрын
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.
@IAmTimCorey
@IAmTimCorey 6 ай бұрын
You are welcome.
@uwejadick4550
@uwejadick4550 Жыл бұрын
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#
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@mikealuspol5819
@mikealuspol5819 Жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Glad I could help.
@ProjectFrugal
@ProjectFrugal 10 ай бұрын
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! :)
@IAmTimCorey
@IAmTimCorey 10 ай бұрын
I am glad it was helpful.
@bstarchild37
@bstarchild37 4 ай бұрын
this was great answered a lot of my questions i loved the tim explains it
@IAmTimCorey
@IAmTimCorey 4 ай бұрын
I am glad it was helpful.
@ravinathsamarakoon6230
@ravinathsamarakoon6230 Жыл бұрын
Thank you so much mr Tim.I hope you willshare more precious information with us .
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@yvonnebong3371
@yvonnebong3371 Жыл бұрын
Thanks for your sharing sir, it helps a lot for studying.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@_isDev
@_isDev 6 ай бұрын
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
@IAmTimCorey
@IAmTimCorey 6 ай бұрын
Awesome, thank you!
@trevoC132
@trevoC132 Жыл бұрын
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
@srenagade7133
@srenagade7133 8 ай бұрын
Thank you some much I'm taking an intro to c# class and I really just needed more info on forms.
@IAmTimCorey
@IAmTimCorey 8 ай бұрын
I am glad it was helpful.
@osamanasim4367
@osamanasim4367 Ай бұрын
Brilliantly explained!! I learned a lot from this video.
@IAmTimCorey
@IAmTimCorey Ай бұрын
Glad it was helpful!
@marcox9637
@marcox9637 10 ай бұрын
amazing video i now learned hwo to use c# and now working as head developer for microsoft
@IAmTimCorey
@IAmTimCorey 10 ай бұрын
I am glad it was helpful.
@montanomariano
@montanomariano Жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Absolutely!
@bobbyonyerionwu8473
@bobbyonyerionwu8473 Жыл бұрын
Good video, buttresses things I was already familiar with. Thank You Sir.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@TheCraftyChateau
@TheCraftyChateau Жыл бұрын
Great video! Thank you!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@AhmadElkhouly
@AhmadElkhouly 3 ай бұрын
responsive design in winforms is a nightmare but it is still a good option. Thanks Tim, your effort is much appreciated. 🎉
@IAmTimCorey
@IAmTimCorey 3 ай бұрын
You are welcome.
@xicofir3737
@xicofir3737 Жыл бұрын
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.
@jayocaine2946
@jayocaine2946 Жыл бұрын
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.
@musacj
@musacj Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks for sharing.
@ElCidPhysics90
@ElCidPhysics90 9 ай бұрын
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.
@IAmTimCorey
@IAmTimCorey 9 ай бұрын
Correct.
@soniabest6888
@soniabest6888 Жыл бұрын
Great tutorial 👍
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks!
@liquidmandotcom
@liquidmandotcom Жыл бұрын
Jezzz, what a great tutorial!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks!
@kon_radar
@kon_radar Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks for sharing.
@S3Kglitches
@S3Kglitches Жыл бұрын
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
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Yeah, that is a bummer.
@JeremiahT
@JeremiahT Жыл бұрын
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.
@S3Kglitches
@S3Kglitches Жыл бұрын
use UserControl as a parent for grouping into a separate component or GroupControl or Panel for grouping locally
@IBNEKAYESH
@IBNEKAYESH Жыл бұрын
VB 6.0 to till now I Love Windows Forms
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Great!
@pavfrang
@pavfrang Жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
DI is a great addition to almost any project. Well done.
@S3Kglitches
@S3Kglitches Жыл бұрын
How do you do dependency injection with constructor injection in UserControls placed into Forms during design time?
@pavfrang
@pavfrang Жыл бұрын
@@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.
@S3Kglitches
@S3Kglitches Жыл бұрын
@@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.
@pavfrang
@pavfrang Жыл бұрын
@@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.
@claudiocespon4128
@claudiocespon4128 Жыл бұрын
Hi Tim! Would be possible a video explaining winforms best practices to implement dependency injection?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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/
@kikko77
@kikko77 Жыл бұрын
haha. very good point on the digital vs paper based prototype :)
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks.
@jesusmysavior7843
@jesusmysavior7843 Жыл бұрын
winForm is best ! next generation!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I'm glad you enjoy it.
@phantompooper
@phantompooper Жыл бұрын
Would it be possible to have a follow-up on the good ways to structure a WinForms project? I've had to use it for a customer before and found MVC/MVVM to be difficult to truly adhere to due to legacy behaviors. Love your series - Thanks for all you do!
@S3Kglitches
@S3Kglitches Жыл бұрын
Basically use kind of mvvm but not pure. Use public properties on UserControls and interact with the UI via these properties which are manually bound to a control.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I believe the recommended UI design pattern is MVP (Model View Presenter), but I personally don't use one for WinForms.
@phantompooper
@phantompooper Жыл бұрын
@@IAmTimCorey Thanks! I greatly appreciate the response!
@orbitalpi812
@orbitalpi812 Жыл бұрын
@@IAmTimCorey Hey Tim! Would you recommend the MVP pattern if you were to start writing a WinForms application using C++/CLI?
@InarusLynx
@InarusLynx Ай бұрын
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. 😁
@IAmTimCorey
@IAmTimCorey Ай бұрын
It has been a while.
@zumasuma5489
@zumasuma5489 Жыл бұрын
Super!!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks!
@GreyHatGenX
@GreyHatGenX Жыл бұрын
thanks
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@user-my3th8vn4g
@user-my3th8vn4g 6 ай бұрын
cool video)
@IAmTimCorey
@IAmTimCorey 6 ай бұрын
Thanks!
@Norman_Fleming
@Norman_Fleming Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks for the suggestion.
@ernest1428
@ernest1428 Жыл бұрын
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
@bobfrank279
@bobfrank279 Жыл бұрын
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?
@kert1464
@kert1464 Жыл бұрын
Great video, please do dependency injection on winforms.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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/
@barry1048
@barry1048 Жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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.
@BarryCouch
@BarryCouch Жыл бұрын
@@IAmTimCorey fair point.
@cameronsidhu5711
@cameronsidhu5711 Жыл бұрын
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
@stianen
@stianen 3 ай бұрын
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.
@IAmTimCorey
@IAmTimCorey 3 ай бұрын
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.
@DonDomaMobster
@DonDomaMobster Жыл бұрын
What? WinForms in 2022 and in .NET 6? At first the title confused me lol! I still have to see the video tho.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Yep, it is still around and still being improved.
@lylewyant3356
@lylewyant3356 Жыл бұрын
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#...
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Sounds good.
@user-ue7mk5dk6k
@user-ue7mk5dk6k Жыл бұрын
Great
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks!
@rednibcoding3412
@rednibcoding3412 Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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/
@yperman1
@yperman1 Жыл бұрын
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.
@davidhouser9280
@davidhouser9280 10 ай бұрын
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
@congoleseculture5180
@congoleseculture5180 Жыл бұрын
First here to comment. We love alk you do for the community
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thank you!
@Peractin
@Peractin 5 ай бұрын
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.
@IAmTimCorey
@IAmTimCorey 5 ай бұрын
No, sorry. My recommendation would be to tie into the events to identify when the state changes and update the other list.
@Peractin
@Peractin 5 ай бұрын
@@IAmTimCorey Okay. I'll keep looking. Thanks for replying. I've been making a little progress using ChatGPT as well. 😄
@midknight3350
@midknight3350 Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You can make a WPF GUI look like WinForms. That might be simpler.
@midknight3350
@midknight3350 7 ай бұрын
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.
@randomCADstuff
@randomCADstuff Жыл бұрын
@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...
@hero11520
@hero11520 Жыл бұрын
Awsome
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thank you!
@keegan8517
@keegan8517 3 ай бұрын
Week2 of my college course and we're doing a project in this...I'm so beyond lost.
@IAmTimCorey
@IAmTimCorey 3 ай бұрын
Hopefully this video will help. I also just started a course using WinForms that might be helpful: kzbin.info/www/bejne/fIbUq2WCe5l1i9Usi=gYmMiulMrRUgMvas The first coding video will come out on Monday.
@giorgosfilippas259
@giorgosfilippas259 Жыл бұрын
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
@crytilis
@crytilis 11 ай бұрын
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.
@IAmTimCorey
@IAmTimCorey 11 ай бұрын
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/
@TECHN0HACKER
@TECHN0HACKER Жыл бұрын
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
@madisonbk
@madisonbk Жыл бұрын
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
@montanomariano
@montanomariano Жыл бұрын
Since this is in dotnet 6, do you have access to the dotnet core DI container? It’d be great not to have to depend on external libraries to have DI
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Yep, you can use the DI from Microsoft in WinForms.
@Valeregeorge
@Valeregeorge 3 ай бұрын
Hello I love your video. Is there any way I can download the whole solution to play with
@IAmTimCorey
@IAmTimCorey 3 ай бұрын
There's a link in the description to download it.
@mohanada1086
@mohanada1086 Жыл бұрын
Hi, thank you for the video it really helpful since I'm very beginner to this. So, I'm using Microsoft Visual Studio 2022 and I notes your code has curly parentheses and mine does not, what is the difference? does that matter?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
The type of character matters, yes. This is a curly brace: { where this is a paranthesis: ( - Both are used and they have different purposes. One cannot be substituted for the other.
@AanDahliansyah
@AanDahliansyah Жыл бұрын
There were a time where the partial class is not invented (.Net 1). So Visual Studio generate InitializeComponent Region in the same class file.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Yeah, that was fun.
@lifeonearth6906
@lifeonearth6906 11 ай бұрын
Why you needed to restart, didnt we had task manager at that time?
@ademineshat
@ademineshat Жыл бұрын
Waiting for MAUI videos 🙂
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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.
@ElCidPhysics90
@ElCidPhysics90 9 ай бұрын
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?
@IAmTimCorey
@IAmTimCorey 9 ай бұрын
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.
@user-rh5wo3hk2b
@user-rh5wo3hk2b 9 ай бұрын
how can we get extra toolbox items? like dialing gauge etc?
@IAmTimCorey
@IAmTimCorey 9 ай бұрын
There are companies like Telerik, Dev Express, Syncfusion, etc. that provide additional controls if you don't want to build your own.
@JamesOfToya
@JamesOfToya 3 ай бұрын
How do you get that home page in VSC? I couldn't even start the video
@IAmTimCorey
@IAmTimCorey 3 ай бұрын
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.
@spowers0409
@spowers0409 Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I’ve not seen that before. You can add the event using the event list instead.
@mr.weerasingheu.k.2352
@mr.weerasingheu.k.2352 Жыл бұрын
Hey fast learners. This is the tutorial you were looking for! Thank me later 😉
@King-Merlin
@King-Merlin Жыл бұрын
Yes Winforms👍🏽👍🏽👍🏽, and next dependency injection in winforms
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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/
@AUS10indeed
@AUS10indeed Жыл бұрын
Should we follow this video or your older video in the C# Mastercourse?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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.
@TechKidShazil
@TechKidShazil Ай бұрын
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?
@IAmTimCorey
@IAmTimCorey Ай бұрын
It could.
@PsychopathMarketing
@PsychopathMarketing Жыл бұрын
Can you do a WinForms with Selenium tutorial?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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/
@Raj-iz9uz
@Raj-iz9uz Жыл бұрын
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
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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.
@SuchByte
@SuchByte Жыл бұрын
Can you upload a video about the Uno Platform Ui framework?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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/
@GameDevNerd
@GameDevNerd Жыл бұрын
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.
@youseff1015
@youseff1015 Жыл бұрын
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?
@micro2743
@micro2743 Жыл бұрын
He doesn't even have the Windows App SDK installed.
@micro2743
@micro2743 Жыл бұрын
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.
@S3Kglitches
@S3Kglitches Жыл бұрын
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
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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.
@micro2743
@micro2743 Жыл бұрын
@@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!
@OctavianUser
@OctavianUser Жыл бұрын
Are you considering to make a video about Avalonia UI? I was wondering about desktop cross-platform apps, read about MAUI, but it doesnt support Linux and then I found Avalonia.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
It is on the suggestion list: suggestions.iamtimcorey.com/Details/62565bc80b6906f2d6876c0a
@jasonlee557
@jasonlee557 Жыл бұрын
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
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I do that in this course (free on KZbin): kzbin.info/aero/PLLWMQd6PeGY3t63w-8MMIjIyYS7MsFcCi
@troymitchel4790
@troymitchel4790 Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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.
@azad2096
@azad2096 Жыл бұрын
for that case you have UWP or WPF
@S3Kglitches
@S3Kglitches Жыл бұрын
TableLayoutPanel together with control's Dock and Alignment properties are your friend
@makisekurisu4367
@makisekurisu4367 8 ай бұрын
1:01:25 Best Practices timestamp
@zilog1
@zilog1 10 ай бұрын
so if i wanted to recreate my app that isnt a "RAD/Temp" app like with dotnet and winforms what else would i program it in? C++ with direct calls to the win32 api?If this isnt a permanent and final version, then what is?
@IAmTimCorey
@IAmTimCorey 10 ай бұрын
I think you are confusing RAD with temporary. They aren't the same thing. You can create a sample application quickly, but you can also create a real application quickly with WinForms. WinForms is absolutely a production-ready/permanent/final product. Companies have been using it for decades for their production solutions and Microsoft has kept it up to date because of that.
@zilog1
@zilog1 10 ай бұрын
@@IAmTimCorey oh I see. So rad is the process and win forms is just the thing to use to help make windows. So making a program ready for production, using winforms is fine. Thanks bunches.
@itsmundo
@itsmundo 7 ай бұрын
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.
@IAmTimCorey
@IAmTimCorey 7 ай бұрын
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.
@itsmundo
@itsmundo 7 ай бұрын
@@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!
@UnbidBubble6901
@UnbidBubble6901 26 күн бұрын
how to make the toolbox sidebar show up?
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
If it isn't open already, you can go to the View menu and select Toolbox.
@harag9
@harag9 Жыл бұрын
I've been doing WinForms in .Net Framework for quite a few years now, I was just wondering how easy is it to port over a winform from 4.8 framework over to .net 6/7 ? I've not done any .Net coding yet as I spend most of my time with Framework 4.8.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Fairly simple. I took the Tournament Tracker application we built in a course (WinForms, Class Library, WPF, and ASP.NET MVC - all .NET Framework) and made another course that upgraded all of them to .NET Core 3.0 to show how it is done. Upgrading from there is rather simple. Here is the course: www.iamtimcorey.com/p/upgrading-to-net-core-from-start-to-finish
@harag9
@harag9 Жыл бұрын
@@IAmTimCorey Thanks for pointing out the course. Silly me, After looking at the link, I've already bought that course and the getting started with CORE course. I really need to find time to do these. :)
@marvelcz8974
@marvelcz8974 Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Great!
@jeremy_carver
@jeremy_carver Жыл бұрын
"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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Agreed.
@levshanley3776
@levshanley3776 7 ай бұрын
"If you are brand new at C#, this is not a place to start" please email this to my teacher, sir
@IAmTimCorey
@IAmTimCorey 7 ай бұрын
You can always forward it to them. I’d love to talk to them about it.
@UnknownMoses
@UnknownMoses Жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
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.
@UnknownMoses
@UnknownMoses Жыл бұрын
@@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.
@UnknownMoses
@UnknownMoses Жыл бұрын
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.
@keyser456
@keyser456 Жыл бұрын
I'm struggling with an issue where the Toolbox is not displaying any controls, and this is in a stock WinForm project in .NET 6 from the template. I "reset" the toolbox, restarted VS, even rebooted my machine -- nothing doing. In a .NET Framework (4.8) WinForm project that Toolbox works just fine w/ all the usable draggable controls. In the .NET 6 project, if I "Show all" I can see the grayed out controls for .NET 6, but you can't do anything with them. Some kind of versioning issue maybe?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Make sure that a form is actually selected, not the code behind file or another file. The editor will only show the tools for what is selected.
@keyser456
@keyser456 Жыл бұрын
@@IAmTimCorey ​ Yes. The form designer is open and the form is selected. I started in WinForm development in .NET in like 2001 in the very early days, graduating from MS Access (amazingly underrated in its day) prior to that, but I'm very familiar with the IDE and designers. I think it's definitely a DotNet 6 thing and I think like you said in the video, it's a brand new Form designer in VS. I've stopped short of "repair"ing VS because that seems a bit extreme.
@keyser456
@keyser456 Жыл бұрын
As a follow up, I tried removing and re-adding Windows Desktop Dev in the Installer w/ no luck yesterday. I finally bit the bullet today and did a repair through the installer. It was painful but it did the trick. The toolbox items are back.
@cabba361
@cabba361 Жыл бұрын
Tim Corey i've recently been seeing people saying that winforms is dead and is obselete and out classed by wpf etc. Is this true and is it better to learn wpf instead of winforms ?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Learn C# well. Then, you will have a rock-solid foundation to build on for either one. As for which specifically to learn, learn both. YOu will probably need to use both if you want to be a desktop developer. Both are valuable. WinForms has been around longer and doesn't have all the nice features WPF does, but it also appears to be set to outlast WPF as well.
@cabba361
@cabba361 Жыл бұрын
@@IAmTimCorey great i was asking as i learned c# well and now im trying just to find the right path for me
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 56 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 56 МЛН
C# Compare Windows Forms vs WPF vs UWP
8:17
Programming w/ Professor Sluiter
Рет қаралды 65 М.
.NET Framework vs .NET Core vs .NET vs .NET Standard vs C#
25:14
IAmTimCorey
Рет қаралды 544 М.
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 772 М.
Every single feature of C# in 10 minutes
9:50
Train To Code
Рет қаралды 104 М.
Which Programming Techniques Should Every Developer Know?
16:39
IAmTimCorey
Рет қаралды 32 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 86 М.
5 Signs of an Inexperienced Self-Taught Developer (and how to fix)
8:40
Is LEARNING WPF still WORTH it in 2023?
10:59
tutorialsEU
Рет қаралды 42 М.
Dependency Injection in .NET Core (.NET 6)
1:00:32
IAmTimCorey
Рет қаралды 184 М.