注册 登录
编程论坛 VB.NET论坛

点击自定义按钮第二次会无响应

星星的光芒 发布于 2017-03-21 17:30, 2018 次点击
只有本站会员才能查看附件,请 登录

显示了自定义按钮但是显示不出系统按钮
点击了自定义按钮会无响应,也无法关闭vbhost.exe
Public Class Form1
    Dim WithEvents 顺序 As 顺序结构 ‘顺序结构是自定义的一个按钮
    Dim WithEvents BUTTON1 As System.Windows.Forms.Button
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Me.Width = 900
        Me.Height = 700
        顺序 = New 顺序结构
        顺序.Location = New Point(0, 0)

        BUTTON1 = New Button
        BUTTON1.Text = "bu"
        BUTTON1.Location = New Point(0, 50)
        Me.Controls.Add(BUTTON1)
        Me.Controls.Add(顺序)
    End Sub



    Private Sub BUTTON1_Click(sender As Object, e As EventArgs) Handles BUTTON1.Click
        MsgBox("DIANJI")
    End Sub

    Private Sub 顺序_Click(sender As Object, e As EventArgs) Handles 顺序.Click
        MsgBox("DIANJIshunxu")
    End Sub
End Class
2 回复
#2
星星的光芒2017-03-22 10:44
求围观啊
#3
haigecnpeng2017-03-25 23:44
这得看你顺序结构继承自哪个控件啊,发这些没用
1