在多个文本字段上粘贴序列号 [英] Pasting of serialnumber over multiple textfields

查看:116
本文介绍了在多个文本字段上粘贴序列号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,用户可以使用32个字符的序列号升级其产品(从试用版到完整版).

In my application users can upgrade their product (from trial to full) using a 32 characters serialnumber.

为使(付费)客户对用户尽可能友好,我希望能够复制并粘贴序列.

To make it as user friendly as possible for my (paying) customers I would like to be able to copy and paste the serial.

我希望我的客户将光标放在许可证下的第一个字段中,当用户粘贴32个字符的许可证时,我希望它填充所有字段.

I want my customers to place the cursor in the first field under license and when the user pastes the 32 chars license I want it to fill all the fields.

我不知道从哪里开始,所以如果您能指出正确的方向,那将是很好的.

I don't know where to start so if you can point me in the right direction that would be great.

推荐答案

在第一个文本框中,我会设置一个很大的限制.

In the first textbox, I would put a large limit.

在文本已更改"上,检查长度.如果更改大于4(您的最大值).删除多余的内容,并将其散布在您的文本框中.

On the 'text changed', check the length. If the change is greater than 4 (your maximum). Delete the extra stuff and spread it over your textboxes.

如果您复制粘贴,它将文本更改为32,并且可以正常工作.您还可以更改光标(我认为它是.Focus(),但我可能错了),因此它会自动在框之间跳".

If you copy-paste, it'll text change of 32, and it would work. You could also change the cursor (I think its .Focus() but I could be wrong) so it automatically 'hops' between the boxes.

这篇关于在多个文本字段上粘贴序列号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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