WPF or Windows Forms

J

John

Hi

If I have a choice of WPF or Windows Form versions of a control which one
should I purchase?

Thanks

Regards
 
J

Jon Skeet [C# MVP]

John said:
If I have a choice of WPF or Windows Form versions of a control which one
should I purchase?

Without wishing to be obvious: whichever framework you plan to write
your application in.

That will depend on a number of factors:

1) What operating systems do your clients have? WPF only works on
reasonably recent versions of Windows (e.g. not Win98)

2) What version of Visual Studio do you plan to use to develop your
application? Visual Studio 2008 has WPF support, but you'd have to use
various extensions and plug-ins for VS2005, which aren't terribly
satisfactory.

3) Do your clients have .NET 3.0 installed? Are you happy to install it
on their boxes?

WPF is (in my view) a much more pleasant UI library to work with than
Windows Forms - but it does require more modern software to support it.
 
J

John

Thanks. I use vs 2008 and all clients have win 2000 but mostly winxp.

Does wpf reduce application execution speed noticeably compared to windows
form?

Thanks

Regards
 
J

Jon Skeet [C# MVP]

John said:
Thanks. I use vs 2008 and all clients have win 2000 but mostly winxp.

Does wpf reduce application execution speed noticeably compared to windows
form?

It depends what you do with it - and what graphics card you've got. WPF
is accelerated by graphics cards (I believe) whereas Windows Forms
doesn't take as much advantage of them.

I believe that WPF is much more efficient overall - but tends to be
used to do snazzier things, which obviously have their own costs.

Personally, I'd try the kinds of things you want your app to do,
prototyping in both frameworks, and make a decision when you've got
that data.
 
S

Steve Gerrard

Jon said:
I believe that WPF is much more efficient overall - but tends to be
used to do snazzier things, which obviously have their own costs.

Jon, do you see future support as an issue at all? Or do you expect both to be
equally well supported long term?
 
J

Jon Skeet [C# MVP]

Steve Gerrard said:
Jon, do you see future support as an issue at all? Or do you expect both to be
equally well supported long term?

I suspect both will be supported for the foreseeable future. WPF has
been given so much emphasis that MS would lose face by dropping it now,
and there's so much code using Windows Forms that it would be madness
to stop supporting that.
 
G

Galen Somerville

Jon Skeet said:
I suspect both will be supported for the foreseeable future. WPF has
been given so much emphasis that MS would lose face by dropping it now,
and there's so much code using Windows Forms that it would be madness
to stop supporting that.

Look how much code used VB6 and they dropped that. Why wouldn't they drop
Windows Froms too.

Galen
 
J

Jon Skeet [C# MVP]

Look how much code used VB6 and they dropped that. Why wouldn't they drop
Windows Froms too.

True enough - but VB6 was sounding "old" by then. WinForms may sound
old compared with WPF, but it's still on the shiny .NET platform
they're pushing.

I don't *think* MS would drop support for it any time soon...
 
R

RobinS

Jon Skeet said:
True enough - but VB6 was sounding "old" by then. WinForms may sound
old compared with WPF, but it's still on the shiny .NET platform
they're pushing.

I don't *think* MS would drop support for it any time soon...

I agree, especially since there's so many controls not yet available in WPF,
and it's not as stable as Windows Forms. To me, it also seems like it's more
for graphics type apps than for business store-data-and-report-it kind of
apps.

Just my two cents' worth.
RobinS.
 
S

Smokey Grindel

"WinForms" is just a wrapper for Win32 forms... to drop Win32 forms you'd
have to rewrite every windows app out there that has a UI... so don't epect
MS to drop them anytime soon...
 
K

kimiraikkonen

I agree, especially since there's so many controls not yet available in WPF,
and it's not as stable as Windows Forms. To me, it also seems like it's more
for graphics type apps than for business store-data-and-report-it kind of
apps.

Just my two cents' worth.
RobinS.- Hide quoted text -

- Show quoted text -

I suspect WPF may require a graphic card as heavy as Vista's aero with
no certain experience.
 
T

Terry

I have to wonder if VS2008/WPF is really ready for prime time. I had some
time this weekend and finally installed the DVD with VS2008 I had gotten.
Open a WPF application and place a button on the form, code the click event
to show a message box, hit the F5 key and get an error that has nothing to do
with my code!
Error Option Strict On disallows implicit conversions from
'System.Windows.Application' to 'WpfApplication1.Application'.

It was easy to fix, but it sure makes me wonder if it is worth my time to
even start to use WPF yet!
 
B

BlackWasp

I have started down the WPF path as a learning exercise. It does seem to be
quite fun and like the way that the vector-based output resolves the problem
of pixel-based rendering. (Jumping from my 1280x1024 19" LCD to my
1920x1200 15" laptop shows the problem to good effect!)

I haven't noticed any stability problems as yet but there are some controls
missing as you point out. I will be trying out the grid and other controls
from Infragistics pretty soon I imagine. Anybody got any experience of
these - good or bad?
 
T

Terry

Well I have spent some more time with it and am even less impressed. Just
fooling around with a regular windows form app. and am having all sorts of
wierd problems. Half the time when I hit the F5 key, I get 2 (back to back)
error messages telling me that the <path>.form1.vb can not be accessed at
this time. I put controls on the form and hit the F5 key, and the controls
arn't there in run mode. I hit save and get out and back in and my changes
wern't saved! This has happened several times! It may have something to do
with resizing the form, not sure yet. But like I said - I am not impressed!
I am using the version that came with my MSDN subscription that I received a
couple of months ago - wonder if there is an update somewhere.
 
B

BlackWasp

Weird. I am using the Team Development version downloaded from MSDN.

I am only using C#, not VB. Can't see why this would be a problem though.
 
A

Alex Clark

I have to wonder if VS2008/WPF is really ready for prime time.

It isn't. Plain and simple. WPF is to WinForms as Vista is to Windows;
some nice shiny new promises with very questionable implementation.

I started to rewrite a small stats application for one of my customers a few
weeks ago. I got as far as wondering why I couldn't get root-lines to show
up on a tree-view control, and after much Googling realised that I'd need
100+ lines of XAML template-altering non-intuitive chevron and curly bracket
laced code written by some hobbyist on the internet for something that still
wouldn't quite work the same way as the original root lines in good old
fashioned WinForms. This is how MS define WPF as being "finished". Yeah,
right...

If MS really want people to start seriously developing with this new
platform, they need to finish it first. Some areas feel like giant leaps
forward, others feel like big steps backwards and some controls just haven't
been implemented at all.

Couple that to a severe lack of decent examples and sample code, and the web
being littered with samples that date back to November CTPs using code that
doesn't work anymore, and it didn't take me long to realise I won't be using
WPF for anything any time soon.

Error Option Strict On disallows implicit conversions from
'System.Windows.Application' to 'WpfApplication1.Application'.

Yep, I got that every time as well. Turns out VS2008 isn't strictly
finished for the new platform either. There were many basic GUI things I
found that couldn't be done in VS and required me to use Expression Blend,
many simple layout things I couldn't do in Expression that I had to do in
VS2008 (I can't tell you how much fun it is to keep switching from one
gigantically memory hungry app to another every 5 minutes, telling it to
reload your project) and some relatively simple things that couldn't be done
in either one and required me to edit XAML directly.


And don't even get me started on the new printing services. Such a
collossal wreck that even Tom Cruise himself wouldn't be able to help.
 
A

Alex Clark

Smokey Grindel said:
"WinForms" is just a wrapper for Win32 forms... to drop Win32 forms you'd
have to rewrite every windows app out there that has a UI... so don't
epect MS to drop them anytime soon...

No. There's nothing stopping MS from dropping WinForms support from .NET
4.0; it has nothing to do with continuing support for Win32 forms at all.
WPF is also based at its lowest level on Win32 forms and is essentially just
another wrapper around it with some DirectX thrown in for fun.

The WinForms base classes could effectively be culled and replaced by WPF in
..NET 4.0 and it wouldn't have the slightest impact on the existence of Win32
forms in Vista or Windows 7.

The only thing stopping MS from doing it is how much it would piss off all
the programmers, which they're working to make obselete in the next release
of VS ("Oslo") anyway...
 
H

Herfried K. Wagner [MVP]

Alex,

Alex Clark said:
I started to rewrite a small stats application for one of my customers a
few weeks ago. I got as far as wondering why I couldn't get root-lines to
show up on a tree-view control, and after much Googling realised that I'd
need 100+ lines of XAML template-altering non-intuitive chevron and curly
bracket laced code written by some hobbyist on the internet for something
that still wouldn't quite work the same way as the original root lines in
good old fashioned WinForms. This is how MS define WPF as being
"finished". Yeah, right...

Let's hope that Microsoft does not only plan to add new controls to WPF
(ribbon etc.) but complete the existing WPF controls:

..NET 3.5 Client Product Roadmap - ScottGu's Blog
<URL:http://weblogs.asp.net/scottgu/archive/2008/02/19/net-3-5-client-product-roadmap.aspx>
-> "WPF Control Improvements"
-> "VS 2008 WPF Designer Improvements"

Currently I would not use WPF because the existing controls are so
incomplete and filling the gaps with custom styles will may require a
partial rewrite when the styles are added to the controls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top