递增文本框字符 [英] incrementing Textbox characters

查看:101
本文介绍了递增文本框字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我是否有一个带字母数字001,002,003,numbers.text的文本框,以及另一个名为suffix.text的文本框,如果用户输入001,我将如何自动增加后缀作为numbers.text中的第一个条目,然后是您在numbers.text中添加的下一个值是001,我需要后缀.text自动显示,A
所以看起来像

number.text后缀.text
001
001 a
001 b
002
002 a

Etc

Hi i would like to know if i have a textboxt with alpha numeric numbers 001 ,002,003 , numbers.text, and a second textbox called suffix.text how would i be able to auto increment the suffix so if the user enters 001 as the first entry in the numbers.text and then the next value you they add in the numbers.text is 001,i need the suffix.text to automatically show, A
so it would look like

number.text suffix.text
001
001 a
001 b
002
002 a

Etc

推荐答案

我将使用链接列表(或VB.NET中存在的任何等效列表)来存储带有值和后缀对的结构.
然后,在每次输入之后,我都会计算与您输入的值相等的值(因此,应在editbox的change事件中完成此操作).
这全都取决于您要对后缀进行的操作,我将尝试使用ascii表来自动增加后缀,并且如果由于z +#的数量等于输入了最后一个,然后我将开始添加另一个以"a"开头的ascii.

使用ascii可以轻松地通过微积分更改字母.

控制溢出,然后就可以完成...

这不是代码,而是一堆可以帮助您的想法.

祝你好运.
I would use a linked list (or any equivalent present in VB.NET) to store a struct with the pairs of values and suffixes.
Then after each entry I would count the values that are equal than the one you''ve entered (so this should be done in the change event of the editbox).
It all depends on what you want to do in terms of the suffixes, I would try to use the ascii table to increment the suffix automatically and if you are overflowing the "z" char due to an amount of z+# of values equal than the last one entered, then I would start adding another ascii start "a".

Using ascii makes it easy to change letters by calculus.

Control the overflow and then you are done...

This is not code but a bunch of ideas that could help you.

Good luck.


这篇关于递增文本框字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆