TheSwamp

Code Red => .NET => Topic started by: Augusto on January 08, 2021, 06:15:57 AM

Title: WPF or Windows Forms
Post by: Augusto on January 08, 2021, 06:15:57 AM
Assuming your application needs forms and palettes, what do you consider best for development, WPF or Windows Forms?

I'm still giving my first steps in C#, doing some tests. If possible I would like to know your point of view on these technologies as pros and cons, reasons to use or not.

In addition, I have other doubts regarding the behavior of these components in different environments, such as a computer whose font scale is different from 100%.

Looking at this example on the Kean website, I could see that it creates and changes a palette referencing Windows Forms components.
https://www.keanw.com/2015/09/creating-an-autocad-palette-dynamically-to-launch-commands-and-methods-tagged-using-net.html (https://www.keanw.com/2015/09/creating-an-autocad-palette-dynamically-to-launch-commands-and-methods-tagged-using-net.html)
Title: Re: WPF or Windows Forms
Post by: huiz on January 08, 2021, 01:20:57 PM
Winforms is a bit easier and if you scale the form with DPI instead of Font, it will scale not really bad on 4K.


WPF is a b*tch and you'll start to hate it real quickly but it is a much better choice. I will never return to WinForms. You can do so many great things when you have more experience.
Title: Re: WPF or Windows Forms
Post by: gile on January 09, 2021, 05:01:01 AM
Hi,

You can have a look to this modest contribution (https://gilecad.azurewebsites.net/UserInterfaces_en.aspx) about user interfaces with AutoCAD .NET.
Title: Re: WPF or Windows Forms
Post by: themethodman on January 10, 2021, 05:38:57 PM
I've used winforms in the past due to its simplicity.

My user interfaces aren't complicated so I followed the keep-it-simple-stupid approach.

They also fit nicely in with most of autocads own user interface menus as well.
Title: Re: WPF or Windows Forms
Post by: Augusto on January 13, 2021, 09:37:20 AM
Hi,

WPF is a b*tch and you'll start to hate it real quickly but it is a much better choice. I will never return to WinForms. You can do so many great things when you have more experience.

Thinking about avoiding problems in my first project, I will consider using WPF in the next time.

You can have a look to this modest contribution (https://gilecad.azurewebsites.net/UserInterfaces_en.aspx) about user interfaces with AutoCAD .NET.

Excellent tutorial!
I will definitely revisit it in the future.
Thank you for sharing your knowledge.

I've used winforms in the past due to its simplicity.
My user interfaces aren't complicated so I followed the keep-it-simple-stupid approach.
They also fit nicely in with most of autocads own user interface menus as well.

Even though I know that WPF increases the possibilities of personalization, I will use Windows Forms because I am used to its use in applications outside of autoCAD.
I believe that this way my performance will be better initially. I hope I'm not mistaken.

Thank you all for the answers.