本文介绍了TextBox数据验证或不为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

在存储数据时,我使用under提及命令来控制零位/空白字段.

CType(IIf(txttotal.Text = "", 0, txttotal.Text), String)

但是有可能光标将不允许继续移动,直到对数据进行检查.

另外,我们还有第二种选择可以像在每个文本上那样进行操作

Dear All,

I using the under mention command to control on Zero/Blank Field at the time of storage of data.

CType(IIf(txttotal.Text = "", 0, txttotal.Text), String)

But is it possible that the cursor will not allow to move next on untill checking of data.

Else we have second option to done like that on each text

Private Function IsDataValid(ByVal InputData As String) As Boolean        ''Return true if the input data is numeric.
If Not IsNumeric(InputData) Then
       ErrorProvider1.SetError(txtpatient_age, "Invalid age")            Label1.Visible = True
Else
Label1.Visible = False
ErrorProvider1.Clear()
End If
End Function 



当我们有超过25个文本框并希望每个文本的有效日期时,就会出现主要问题.

[edit]标题-不要大喊! -OriginalGriff [/edit]



Major problem occurs when we have more than 25 Text box and want to valid date each of them.

[edit]Title - DON''T SHOUT! - OriginalGriff[/edit]

推荐答案


这篇关于TextBox数据验证或不为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 21:49