I’m implementing a selection box for countries in my app.
the code is exceedingly simple:
I have a module Info with a property ListOfAllCountires() as String
The code in the ComboBox is very simple:
Sub Open() Handles Open
me.AddRows Info.ListOfAllCountries
End Sub
and
Sub TextChanged() Handles TextChanged
// delete all rows in array
Me.DeleteAllRows
If Me.Text = "" Then
Me.AddRows Info.ListOfAllCountries
Else
Dim selStart As Integer = Me.SelStart
For Each country As String In ListOfAllCountries
If InStr( country, Left(Me.Text, selStart ) ) > 0 Then
Me.AddRow country
End If
Next
End If
End Sub
On the Mac it works as expected and typing Ger shows the following countries:
Algeria Germany
Niger
Nigeria
However on Windows 10 it just shows the countries STARTING with Ger (with autocomplete enabled) or nothing (with autocomplete disabled - it also deletes the entered text).
Interestingly while with autocomplete enabled the automatic drop down shows everything starting with Ger, clicking on the show part of the ComboBox shows the correct four countries.
Any way to disable the automatic menu on Windows???
When AllowAutoComplete is False (default) then (at least on my Windows 10 VM), the control is broken. The text you type gets deleted as you type. This must be a bug.
If AllowAutoComplete is True then, as you say, it correctly displays countries starting with the letters you type but doesn’t detect matches within the countries, unlike macOS which does. The behaviour on Linux matches Windows 10.
Highlight the text you want to quote by selecting it (just like you would if you were going to copy it) and a little button should appear next to your mouse cursor saying “Quote”. Click that and it’ll wrap the text in a quote citing the author.
Your answer was missing the important info that you need to set autocomplete to true in the IDE AND turn it off in the open event (as counter-intuitive as that may be).
But playing around I came to the same conclusion (by which time I had forgotten about what you wrote).