Thang Nguyen Posted February 11, 2009 Report Share Posted February 11, 2009 Hi, I have an issue with control panel which I still cannot find a reasonable way to solve it. I have two number controls which allow user to input value. These controls can only be updated when after inputting the value you click somewhere else or click on "OK" button. The issue is after inputting the value, user will hit enter key, then the last nummeric control will not be updated. If you have experience with this please tell me how to solve this problem. Thank you so much, Thang Nguyen Quote Link to comment
hooovahh Posted February 11, 2009 Report Share Posted February 11, 2009 I remember having this problem before. What is happening is when the user presses enter the new value in the string control is not updated before the event is triggered that the OK button has changed value. The easy solution is to right click the string control and enable "Update Value While Typing" Of course this could have a bad side effect if you are triggering events on the changing string control, but it doesn't sound like you are. EDIT: sorry you said you were using a numeric control, in that case I don't know what to do. I've played with it for a few minutes and it does seem odd. I setup the same example you mentioned, a numeric control, then an event for changing value of the ok button, then tied the return key to the toggle. After that I made a wait for 1 second, then read the value from the control and put it into an indicator but the value didn't update. Quote Link to comment
Thang Nguyen Posted February 11, 2009 Author Report Share Posted February 11, 2009 I guess your solution is a good way to solve this problem. I can use two string controls then convert their value to number. As I understand, the value is only updated when there is another mouse click event. Quote Link to comment
ned Posted February 11, 2009 Report Share Posted February 11, 2009 QUOTE (Thang Nguyen @ Feb 10 2009, 03:34 PM) Hi,I have an issue with control panel which I still cannot find a reasonable way to solve it. I have two number controls which allow user to input value. These controls can only be updated when after inputting the value you click somewhere else or click on "OK" button. The issue is after inputting the value, user will hit enter key, then the last nummeric control will not be updated. If you have experience with this please tell me how to solve this problem. Thank you so much, Thang Nguyen One option that may help is to check off "Set to focus on toggle" in the Key Navigation properties for whichever button is bound to Enter. If you are using an event structure, read the numeric values in the event case for the OK button. Or, create a timeout case with the timeout wired to a shift register. Start with that shift register set to -1. In the event case for the OK button, set the timeout shift register to 0. All pending events will execute (for example, value change events on your numeric controls), then the timeout will occur. Put your code from the OK button event into that timeout case. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.