08-19-2017 07:30 PM
Bob,
Please note that (late in the discussion) Brandon stated he wanted to emulate an "Instant messaging window".
The bonus property of your simple, elegant, solution does not fit that paradigm (i.e. "clicking out" sends message.).
Consider a user starting a message, then having to respond to other system activity - you would get an incomplete message.
steve
08-20-2017 10:42 AM
@stevem181 wrote:
Bob,
Please note that (late in the discussion) Brandon stated he wanted to emulate an "Instant messaging window".
The bonus property of your simple, elegant, solution does not fit that paradigm (i.e. "clicking out" sends message.).
Yes, I absolutely agree. I don't know all of the details of Brandon's situation, so he may well need extremely fine-grain control and will have to deal with the complexity this entails, but if his needs are not as complex, Simpler Can Be Better. If one needs to guard against "clicking out", it might be simpler to add code specifically for this case (with a text label explaining this contingency) ... It is all a question of coming up with a Good Design (where "Good" is in the Eye of the Beholder, and "This works!" is certainly an acceptable definition ...).
Bob Schor
08-21-2017 11:00 AM - edited 08-21-2017 11:06 AM
Oh, well. Do it the hard way. Good luck explaining the convoluted logic to someone else.
Hello Bob, I'm sorry if I offended you in any capacity. It certainly was not my intent and I fully appreciate you taking the time out of your day to suggest a solution, especially one that would simplify code. That being said the I didn't use the value change event because (on my PC at least) when I use the enter key on the numpad, or when I clicked out the event triggers but, but not when I use the enter key above right shift.
EDIT: with "Limit to Single Line" with works with both Enter keys
08-21-2017 04:00 PM
Ah. If I understand what you just said, you agree with me that my "simple solution" (where I explicitly say you need to "Limit to a Single Line") works with the Numeric Pad Enter Key, the Keyboard Enter Key (the one above Right Shift), and if you signal you are done entering the number by clicking outside the control. I'd choose Simplicity and Maintainability, especially since (to my mind) it doesn't matter how the User signals "I'm Done" as long as it is "logical" and unlikely to break the program (I suggest <Ctrl><Alt><Del> would be a really poor "I'm Done" signal ...).
Bob Schor