错误:句柄子句需要WithEvents [英] Error:Handles clause requires a WithEvents

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

问题描述

Hai您可以检查我的编码吗,我收到一个错误的Handles子句,要求在包含类型或其基本类型之一中定义一个WithEvents变量.
对于您的信息,我正在使用Visual Studio2005.我还强调了问题出在哪里.

Hai could you check my coding i got an error Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
For your info i am using visual studio 2005.I also highlight where is the probleam is came.

Public Class Admin
    Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
    End Sub

    Private Sub btnins_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnins.Click;
        Me.StaffBindingSource.AddNew()
    End Sub

    Private Sub StaffBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StaffBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.StaffBindingSource.EndEdit()
        Me.StaffTableAdapter.Update(Me.LoginDataSet.staff)
    End Sub

    Private Sub Admin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'LoginDataSet.staff_Tombstone' table. You can move, or remove it, as needed.
        Me.Staff_TombstoneTableAdapter.Fill(Me.LoginDataSet.staff_Tombstone)
        'TODO: This line of code loads data into the 'LoginDataSet.staff' table. You can move, or remove it, as needed.
        Me.StaffTableAdapter.Fill(Me.LoginDataSet.staff)
    End Sub

    Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
        Me.Validate()
        Me.StaffBindingSource.EndEdit()
        Me.StaffTableAdapter.Update(Me.LoginDataSet.staff)
    End Sub

    Private Sub btnrem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnrem.Click
        Me.StaffBindingSource.RemoveCurrent()
    End Sub
End Class

推荐答案

错误表示它的意思.您是否发生了按照指示执行的操作?您是否想过参考您的参考书或google这个错误消息?令我感到困扰的是,我们的行业正充斥着那些几乎不会打字,无法自己思考的人,并期望随便的陌生人将弥补他们的才智,才干和愿意做任何工作的差距. br/>
[
The error means what it says. Did it occur to you to do what it tells you to do ? Did it occur to you to refer to your reference books or google this error message ? It troubles me that our industry is being flooded with people who can barely type, who can''t think for themselves, and who expect that random strangers will make up for the gaps in their intellect, aptitude and willingness to do any work.

This[^] was the first hit when I googled your error message.


这篇关于错误:句柄子句需要WithEvents的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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