[SOLVED] How to not auto focus on value in a dropdown
Posted: Mon Mar 31, 2025 6:16 pm
Hi all,
When a value set the value property of a dropdown by logic, it automatically sets focus to the leading matching value in the dropdown.
Does anyone know how to disable this auto focus?
In the example below, "D" is set the value of the drop-down, but "Denmark" is selected.
I want only "D" to be displayed as the drop-down value, not "Denmark".
Regards,
Taku
When a value set the value property of a dropdown by logic, it automatically sets focus to the leading matching value in the dropdown.
Does anyone know how to disable this auto focus?
In the example below, "D" is set the value of the drop-down, but "Denmark" is selected.
I want only "D" to be displayed as the drop-down value, not "Denmark".
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)
Define_Com Class(#PRIM_LIST.DropDown) Name(#DropDown1) Columnheaderheight(0) Columnlines(False) Displayposition(1) Parent(#COM_OWNER) Rowlines(False) Showselection(False) Tabposition(2) Top(48) Height(41) Left(56) Width(164) Autoselect(False) Autoselectitem(False) Dropdownstyle(DropDown)
Define_Com Class(#PRIM_LIST.String) Name(#DropDown1Column1) Columnunits(Proportion) Columnwidth(1) Displayposition(1) Parent(#DropDown1) Sortonclick(True) Source(#STD_TEXTS)
Define_Com Class(#PRIM_PHBN) Name(#Button1) Caption('Button1') Displayposition(2) Left(300) Parent(#COM_OWNER) Tabposition(1) Top(58)
Evtroutine Handling(#Com_owner.CreateInstance)
#STD_TEXTS := *BLANK
Add_Entry To_List(#DropDown1)
#STD_TEXTS := 'America'
Add_Entry To_List(#DropDown1)
#STD_TEXTS := 'Brazil'
Add_Entry To_List(#DropDown1)
#STD_TEXTS := 'Canada'
Add_Entry To_List(#DropDown1)
#STD_TEXTS := 'Denmark'
Add_Entry To_List(#DropDown1)
#STD_TEXTS := 'England'
Add_Entry To_List(#DropDown1)
#STD_TEXTS := 'France'
Add_Entry To_List(#DropDown1)
#STD_TEXTS := 'Germany'
Add_Entry To_List(#DropDown1)
#STD_TEXTS := 'Holand'
Add_Entry To_List(#DropDown1)
Get_Entry Number(1) From_List(#DropDown1)
#DropDown1.CurrentItem.Focus := True
Endroutine
Evtroutine Handling(#Button1.Click)
#DropDown1.Value := 'D'
Endroutine
End_Com
Taku