Jump to content
  • Advertisement
Sign in to follow this  
The Orange Peanut

[.net] Windows forms programming (not using design editor)

This topic is 5076 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
You might consider "C# and the .NET Framework" by Robert Powell and Richard Weeks.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Quote:
Original post by Arild Fines
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).


Really? I thought that modifying things like sizes and such yielded the equivalent results in the form designer.

Matt

Share this post


Link to post
Share on other sites
Quote:
Original post by Arild Fines
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).

Yeah, I 'hacked' one of my programs by making lots of labels static and WFD just deleted them all. I wasn't best pleased.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!