delphi - Firemonkey TNumberBox - new value not available until losing focus -


using tnumberbox control (at least in windows, other platforms too), when type in new value, , press button (tbutton) save changes, upon reading tnumberbox.value property, it's returning original value before edit made. turns out, value not accessible until after control loses focus.

now button used save changes, have deliberately disabled canfocus property, along buttons in app. because style use (jet), focused button looks horrible (black text on dark gray background). not mention, on mobile platforms, focus practically useless in case.

otherwise, if don't disable canfocus on save button, focus taken off of tnumberbox , value property okay. but, when disabling canfocus on save button, focus never taken off of control, , therefore reading value property returns old value.

how can ensure value property returns correct new value without changing save button canfocus?

enabling killfocusonreturn not useful, because users have aware need press "return" or "enter" not option.

note

this problem persists if utilize tnumberbox.onchangetracking event. i'm not sure how event useful if can't read new value.

i discovered firemonkey needs <enter>, or loss of focus, accept value in sort of edit. don't think need kill focus on return.

the real solution seem editing style change display of focused buttons. didn't display of controls, or wanted add graphic, etc., went style in project , made changes wanted.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -