[.net] Windows forms programming (not using design editor)
I have learned the basics of the language and I want to learn Windows Forms programming. I have a book that touches upon the subject (Programming C# by D&D), but it uses the design view mess. I want to understand what's going on underneath the hood before I go about drawing my objects. I also think that learning to do things programmatically would help a bit since my next main goal is to write a game, probably pong. But obviously, first I need to learn windows forms.
Summary of my blabbering: Does anyone know any online tutorials that teach Windows Forms programmatically?
Thank you.
It's actually quite simple. This page: Windows Forms with no VS.NET shows you a very basic WinForms app which you can write in notepad.
Heck, you can even start writing your WinForms app in the IDE and then when you're happy, just expand the "Designer Generated Code" region and modify it to your heart's content.
The best resource, as always, is MSDN which describes all the classes in the System.Windows.Forms namespace very well.
Heck, you can even start writing your WinForms app in the IDE and then when you're happy, just expand the "Designer Generated Code" region and modify it to your heart's content.
The best resource, as always, is MSDN which describes all the classes in the System.Windows.Forms namespace very well.
I think Dean touched on something important. The form designer doesn't hide anything from you. It generates the code you would have written anyway in a region called something like "Form Designer Generated Code".
If I wanted to learn a lot about how to make windows, I would make some windows in the form designer, and then check out the code it generated in the source file.
If I wanted to learn a lot about how to make windows, I would make some windows in the form designer, and then check out the code it generated in the source file.
Quote:Original post by Dean Harding
Heck, you can even start writing your WinForms app in the IDE and then when you're happy, just expand the "Designer Generated Code" region and modify it to your heart's content.
You better move it out of that region/method then - VS will overwrite your changes if you ever open the designer on that form again(which isn't all that unlikely, considering that the design view is the default view for a form).
The Charles Petzold book, "Programming Windows With C#", doesn't use the forms designer at all. He's very focused on GDI+, though.
Quote:Original post by Arild FinesQuote:Original post by Dean Harding
Heck, you can even start writing your WinForms app in the IDE and then when you're happy, just expand the "Designer Generated Code" region and modify it to your heart's content.
You better move it out of that region/method then - VS will overwrite your changes if you ever open the designer on that form again(which isn't all that unlikely, considering that the design view is the default view for a form).
Really? I thought that modifying things like sizes and such yielded the equivalent results in the form designer.
Matt
Quote:Original post by Arild FinesQuote:Original post by Dean Harding
Heck, you can even start writing your WinForms app in the IDE and then when you're happy, just expand the "Designer Generated Code" region and modify it to your heart's content.
You better move it out of that region/method then - VS will overwrite your changes if you ever open the designer on that form again(which isn't all that unlikely, considering that the design view is the default view for a form).
Yeah, I 'hacked' one of my programs by making lots of labels static and WFD just deleted them all. I wasn't best pleased.
Quote:Original post by CpMan
Really? I thought that modifying things like sizes and such yielded the equivalent results in the form designer.
Those kinds of things probably persist. I was thinking more of adding lines, changing them completely etc.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement