I am wanting to provide a drop-down list of values but also enable this to be overridden like the old-school Combobox from Visual Basic. Has anybody done this already?
OK so I sorta worked around this using an autocomplete and adding the Body to the list using OnLoadOptions. The user still needs to select the entry from the list but it does the job.
New-UDAutocomplete -OnLoadOptions {
$arrayList + $Body | Where-Object { $_ -match $Body } | ConvertTo-Json
}
Can you attach a screenshot. I want to see what this looks like. I’m also not clear on the $arrayList + $Body, what are you doing here?
So first off i have a list of colors.
$arrayList = @(
'royalblue',
'limegreen',
'gold',
'crimson',
'aliceblue',
'antiquewhite',
'aqua',
'and so on'
)
If you were to do a ‘normal’ Autocomplete you’d do this.
New-UDAutocomplete -OnLoadOptions {
$arrayList | Where-Object { $_ -match $Body } | ConvertTo-Json
}
Which basically reloads the contents of the list filtered on what you type into the box as you type it.
I just added the + $Body
so its adds what you have typed so far to the list too.