| |

VerySource

 Forgot password?
 Register
Search
View: 2441|Reply: 11

The dialog edit control hexadecimal format input.

[Copy link]

1

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-11-26 13:30:01
| Show all posts |Read mode
An edit control in the dialog box, I want to restrict users to input only in hexadecimal format. Now the received characters are limited to 0~F, and the format problem has not been solved (cannot enter if the space is out). Some classes are too complicated and I want to write my own processing functions. I hope that the masters will not hesitate to enlighten me.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-11-26 13:45:01
| Show all posts
This question is simple! ! pay attention! You must first figure out how to convert hexadecimal to others! Such as 2 8! !
Wait! ! I'll sort out the information and send it to you! !
Reply

Use magic Report

0

Threads

12

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-11-26 15:15:01
| Show all posts
Processing WM_CHAR message, if it is illegal, prohibit it.
Reply

Use magic Report

0

Threads

41

Posts

28.00

Credits

Newbie

Rank: 1

Credits
28.00

 Norway

Post time: 2020-11-26 15:30:01
| Show all posts
Handling OnChar by yourself, you can only enter abcdef and 0-9
But it's not bad to use regular
Reply

Use magic Report

1

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-11-26 18:15:01
| Show all posts
Master upstairs, can you elaborate more? I saw this example. It doesn’t have the function of inputting in hexadecimal format. What I mean is that when editing hexadecimal, the user doesn’t need to consider the input method, he will automatically jump to every two characters he enters. Add a space in the next position? It is best to have sample code, thank you!
Reply

Use magic Report

0

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-11-26 19:00:01
| Show all posts
In fact, this problem can not only be applied to the hexadecimal system, but the master can do this. Set rules for each input in the text box. When the input character meets this rule, the character will be accepted. If it does not meet this rule One-bit rules will not be accepted.
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-11-27 11:15:01
| Show all posts
In fact, this problem can not only be applied to the hexadecimal system, but the master can do this. Set rules for each input in the text box. When the input character meets this rule, the character will be accepted. If it does not meet this rule One-bit rules will not be accepted.
================================================= ==================================
Well, it is to accept first, and then judge, if it is not satisfied, reset the control, it should not be troublesome, but pay attention to the processing if double-byte input
Reply

Use magic Report

1

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-11-27 21:15:01
| Show all posts
What I want to achieve is: every time a character is edited when editing hex, the cursor will automatically jump to the next character editing place without passing through the space in between
Reply

Use magic Report

4

Threads

16

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-11-27 22:30:01
| Show all posts
Isn't it possible to subclass?
Reply

Use magic Report

1

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-11-27 22:45:01
| Show all posts
How can I be more specific?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list