文本框的错误信息 [英] Error message for text boxes

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

问题描述

设置文本框时,我不断收到以下错误消息.

I keep getting the following error message when setting up text boxes.

Error 'txtEmployeeID' is not declared. It may be inaccessible due to its protection level.	


这是我的代码:


This is my code:

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Dim HomePhone As String
    HomePhone = txtHomePhone.Text
End Sub


您可以提供的任何帮助将不胜感激.


Any help you can give would be appreciated.

推荐答案

您的handles语句缺少handles Textbox2.TextChanged

your handles statement is missing the handles Textbox2.TextChanged

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)




注意:通常在从窗体中删除控件时会发生这种情况,它会删除子标题中的Handles事件.


它应该有这样的东西




Note: This normally happens when you delete the control from the form, it removes the Handles event in the sub''s header.


It should have something like this

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

   End Sub


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

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