0

I want to create a rich UI for my desktop app, however, WPF is too complicated for my needs at this point and I'd prefer to use WinForms (if possible). The way I see it, there are two options:

  1. WinForms and loads of custom controls including custom drawing: This would give me fine grained control, however, UI would be too hard coded and would make re-design (even initial implementation) quite a long and tedious affair.

  2. HTML5 UI in WebBrowser Control: I'm strongly leaning towards this option as interface can be (re)designed quite easily and implementation requires minimal code changes. Having said that I have no experience with this and don't know potential issues I might run into.

What do you guys think? Any other suggestions? I haven't completely ruled out WPF, if WinForms is out, then how about WPF vs WebBrowser Control?

Design

tunafish24
  • 2,288
  • 6
  • 28
  • 47
  • If it really is a desktop app, you should really give WPF a try. It might be tricky to start but your result will be way less hacky and painful than with a browser control. And if you go the web browser route, know that there is way better alternative than the WebBrowser control. See http://stackoverflow.com/questions/1495944/webbrowser-control-limitations. In any case, if I were you, I'd forgot about Winforms. – IronSlug Jul 31 '15 at 06:18
  • Third-party components may also be sufficient, depending on your specific needs (Telerik, DevExpress,...) – Saragis Jul 31 '15 at 07:01
  • @Saragis Thanks for the links ! – IronSlug Jul 31 '15 at 08:18
  • Wondering about what you ended up choosing? – NoChance Nov 24 '15 at 04:55

1 Answers1

4

For a desktop app, WPF is most certainly the way to go as it offers the ability to totally re-design controls using Style and ControlTemplate.

Take Skype for Desktop for example. As far as I am aware, is actually a XAML based desktop application (WPF), which means that it's certainly possible to design rich, beautiful applications simply because it's already been done. Visual Studio too is a good example of a XAML based application.

In your situation, I would recommend going down the WPF route as you're targeting the desktop. There are plenty of pretty awesome frameworks which have been created to help make your apps look more awesome, like MahApps and MUI for example, both of which are trying to implement the modern feel of Windows 8+ apps.

What these frameworks essentially do is implement Styles and ControlTemplates to override the default styles and templates of existing controls. I'm sure there are new controls thrown in, but the essence still remains the same.

Take a Button for example, it's very easy to change how a button is presented on the window by using a Style or ControlTemplate. For example:

<Style TargetType="Button">
    <Setter Property="Background" Value="Red"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">
                <Border BorderThickness="0"
                        Background="{TemplateBinding Background}">
                    <ContentPresenter Margin="20,10"/>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

In this very simple example, I have simply changed the default Button style and altered the way it is presented to instead display the content of the button inside a Red Border. This isn't very complicated, however you have an insane amount of freedom, and you can pretty much do anything you like really.

I've heard of games being built in WPF, obviously not AAA games, but relatively simple desktop games, however they use the same principles that I have mentioned to design their controls to meet their needs.

Once you understand how to redesign controls, then the possibilities are practically endless, if you're looking for design inspiration, then check out dribbble.

Mike Eason
  • 9,525
  • 2
  • 38
  • 63