Best ways of implementing GUI, ShowUI vs WinForms vs WPF

Welcome Forums General PowerShell Q&A Best ways of implementing GUI, ShowUI vs WinForms vs WPF

This topic contains 4 replies, has 2 voices, and was last updated by

 
Participant
2 months, 3 weeks ago.

  • Author
    Posts
  • #163229

    Participant
    Topics: 13
    Replies: 42
    Points: 243
    Rank: Participant

    I've been researching many different ways of implementing a GUI in powershell, including:

    1. ShowUI
    2. .NET Windows Forms
    3. WPF

    WPF seems to look the most athletically pleasing but is the most difficult/complex to use. What would you guys recommend to use going forward?

    For background information, I wish to build a GUI with multiple tabs and buttons inside each tab. Anything to make it more athletically pleasing (like it was made in 2019 and not 2008) would be helpful.

  • #163235

    Participant
    Topics: 1
    Replies: 302
    Points: 145
    Helping Hand
    Rank: Participant

    Have a read of Stephen Owen's series on creating GUIs using Visual Studio. It will get you up and running with WPF in no time.

    Part I – Creating PowerShell GUIs in Minutes using Visual Studio – A New Hope

  • #163241

    Participant
    Topics: 13
    Replies: 42
    Points: 243
    Rank: Participant

    Have a read of Stephen Owen's series on creating GUIs using Visual Studio. It will get you up and running with WPF in no time.

    Part I – Creating PowerShell GUIs in Minutes using Visual Studio – A New Hope

    It doesn't seem too bad so far. Thank you for the link, I hadn't come across that site in my research.

    Could you explain to me what the purpose of these lines are? Why are they web links?

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  • #163305

    Participant
    Topics: 13
    Replies: 42
    Points: 243
    Rank: Participant

    It's used to give the XML namespace a unique name:

    https://www.w3schools.com/xml/xml_namespaces.asp

    I've got a Textbox, declared as:

    x:Name="Welcome_Text" HorizontalAlignment="Left" Height="24" Margin="288,9,0,0" TextWrapping="Wrap" Text="Welcome!" VerticalAlignment="Top" Width="197"

    When I'm in the Visual Studio Code debugger, I see a TON of attributes associated with this variable and just about all of them read "" as the value. I assumed that was because I hadn't defined them in the above XAML, but when I found the "Text" attribute, my "Welcome!" was not there, but instead the same error. How can this be? When the form appears, it indeed displays the desired text and I'm able to change the value just fine.

    What's going on here?

You must be logged in to reply to this topic.