??? 04/09/08 12:45 Read: times |
#153048 - Trying to convert after typing is too hard Responding to: ???'s previous message |
It is my opinion that trying to manipulate the boxes after the text values have been entered almost always doomed to not work in some way or another. I have programmed an almost identical type of two digit hex edit box in vB6 and had it work like this:
The model I use works similar to the channel number entry to a TV set the remote control. I captured the event of the edit box that receives the keystroke(s) and first validated as 0-9, A-F, or a-f. I then took the edit box contents and did string processing to shift the last digit left one position and append the new one on the end. The entry cursor is ALWAYS at the right side of the edit box like this. The box always shows the last two entered hex digits. At time of usage the above pre-conditioning of the box contents lowers the need to futz with a lot of value validation at the time you extract the values from the box. There is also no need to support any editing of the box at all because two character keyboarding is the only allowed entry method. If it would be at all useful to you to see the VB6 code for this please let me know and I'll go extract it from a larger application into a simple demo for you to look at. As a side comment...in the interest of OOP (Object Oriented Programming) you may consider that when you have a multiplicity of this type of edit box that the normal edit box should be subclassed to make a derivative control that supports the desired functional behavior. Michael Karas |
Topic | Author | Date |
C++, 8051, cleaning up a mess......need advise | 01/01/70 00:00 | |
Trying to convert after typing is too hard | 01/01/70 00:00 | |
Take a look here... | 01/01/70 00:00 | |
I gave that a run, | 01/01/70 00:00 | |
Maybe this will help | 01/01/70 00:00 | |
Thanks Russ, some thoughts | 01/01/70 00:00 | |
More thoughts | 01/01/70 00:00 | |
Your right, you know how it is | 01/01/70 00:00 | |
Is this it? | 01/01/70 00:00 | |
Well, no | 01/01/70 00:00 | |
Hopefully I can answer this correctly | 01/01/70 00:00 | |
Is Prosise onlin? | 01/01/70 00:00 | |
Emailed link to you | 01/01/70 00:00 | |
Two more questions | 01/01/70 00:00 | |
Placeholders for array data | 01/01/70 00:00 | |
Stop now, before you make things worse! | 01/01/70 00:00 | |
No offense taken at all | 01/01/70 00:00 | |
I got the link | 01/01/70 00:00 |