Page 1 of 1

Combo box entry restraining

Posted: Wed May 16, 2012 9:34 am
by shaosean
Some times you may want to restrain the user to only entering the items set in the menu part of the combo box, here is a quick little script that does that..

Code: Select all

on keyDown pKey
  local tText
  put CR & the text of me into tText
  if (tText contains (LF & the label of me & pKey)) then
    pass keyDown
  end if
end keyDown
When the user presses a key down, the script compares the already entered text plus the new letter to the text property lines and if it is found, we pass the message along to the engine, otherwise we eat the message and nothing happens..