Line break after New-UDTextBox

Line break after New-UDTextBox

avatar
Product: PowerShell Universal
Version: 1.4.6


Sorry for the absolutely idiotic question, but here is my very simple app I’m using to play with.

New-UDApp -title "This Is A Title" -Content {
   New-UDTextbox -Label "First Name" 
   New-UDTextbox -Label "Last Name"
   New-UDButton -Text "Submit"
}


And when Iook at what I’ve made, it’s just two textboxes in a single line followed by the submit in the same line. How do I get the textboxes and buttons on separate lines?

avatar
(anonymous user)

Recommended Answer

I used to do the New-UDElement but New-UDStack is more readable when looking at the code and more cleaner

docs.powershelluniversal.com

New-UDApp -title "This Is A Title" -Content {
    New-UDStack -Content {
        New-UDTextbox -Label "First Name" 
        New-UDTextbox -Label "Last Name"
        New-UDButton -Text "Submit"
    } -Spacing 2 -Direction 'column'
}


All Comments (3)

avatar

There are many options like New-UDGrid and so on
but the simple way would be to put a New-UDElement -Tag “p” -Content {}
after every element

avatar

I used to do the New-UDElement but New-UDStack is more readable when looking at the code and more cleaner

docs.powershelluniversal.com

New-UDApp -title "This Is A Title" -Content {
    New-UDStack -Content {
        New-UDTextbox -Label "First Name" 
        New-UDTextbox -Label "Last Name"
        New-UDButton -Text "Submit"
    } -Spacing 2 -Direction 'column'
}


avatar

This has been very helpful. Thank you!