Flex: Is there anyway to disable the textfield in the NumericStepper and force the user to change the value only by using the up/down buttons?

安稳与你 提交于 2020-01-15 11:46:05

问题


Probably not much more to elaborate on here - I'm using a NumericStepper control and I want the user to use the buttons only to change the value in the NS, not by typing into the control - I couldn't find a property to disable the text - does it exist?

If it doesn't, how would I subclass this thing to disable the text?


回答1:


In general, if you're using mx_internal, there's a decent chance that your app will break between flex versions.




回答2:


Ok - I think I got it - there is no property you can set but you can subclass the control and set:

mx_internal::inputField.enabled = false;

Although that sets up next question about what the hell mx_internal is...




回答3:


mx_internal is a namespace. There's a good explanation of how it all works here:

http://nondocs.blogspot.com/2007/04/mxcoremxinternal.html




回答4:


If you are using the spark NumericStepper, best practice is to create a custom skin and hide the TextInput part (its a required skin part so it has to be in the skin somewhere).




回答5:


text Input has property 'editable' which can be set to false. It worked for me.



来源:https://stackoverflow.com/questions/368954/flex-is-there-anyway-to-disable-the-textfield-in-the-numericstepper-and-force-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!