on May 31st, 2015, 3:45pm, Alincon wrote:How can I limit the number of characters typed into the the textbox section of a combo box? Some modification of this call for a regular textbox, maybe? |
|
Edit: Janet pointed out at the LB Forum that there is in fact an equivalent constant _CB_LIMITTEXT that you can use directly, which is simpler than the solution I posted earlier:
Code: array$(1) = "First item"
array$(2) = "Second item"
combobox #w.cb, array$(), [cbclick], 20, 20, 270, 40
open "Combobox Limit Text" for window as #w
#w "trapclose [quit]"
hwndCB = hwnd(#w.cb)
limit = 10
calldll #user32, "SendMessageA", hwndCB as ulong, _
_CB_LIMITTEXT as long, limit as long, 0 as long, ret as long
wait
[quit]
close #w
end