当我在文本框中写东西时,它允许我在下一个文本框中输入 [英] when i write somthing in text box then it allow me to input in next text box

查看:73
本文介绍了当我在文本框中写东西时,它允许我在下一个文本框中输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目

当我在一个文本框中输入完内容后,应该允许我在一个表格内全部输入下一个文本框.

I have a project

When I have finished inputting in one text box it should allow me to input in next text box all within one form.

推荐答案

我认为您是指控件验证.

在设计器中,将CausesValidation设置为True,这将导致控件在失去焦点等情况下引发验证事件.

下面的代码是一个示例,该示例将始终专注于文本框,直到输入任何有效日期为止.

I think you are referring to control Validation.

In the designer, set the CausesValidation to True, this will cause the control to raise validation events when focus is lost etc.

The code below is an example that will retain focus on a textbox until ANY valid date is entered.

Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
    'text box must contain ANY valid date
    Dim thisText As TextBox = CType(sender, TextBox)

    If Not IsDate(thisText.Text) Then
        MsgBox("You must enter a valid date in the " + thisText.Name)

        thisText.Focus()
    End If
End Sub


我已将其用于密码文本框.所以我应该这样做.
i have it use for password text box.so wht i should have to do.


这篇关于当我在文本框中写东西时,它允许我在下一个文本框中输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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