我會告訴你我的代碼第一:表中的FormClosing事件未啓用工作
Private Sub AddProductToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AddProductToolStripMenuItem.Click
Me.Enabled = False
Dim frmAddProduct As New FormAddProduct
frmAddProduct.Show()
frmAddProduct.Owner = Me
End Sub
這是我的主窗體調用addProduct命令的形式,這是我在addProduct命令
Private Sub FormAddProduct_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
ButtonReset.PerformClick()
Lock()
Me.Owner = Nothing
Me.Hide()
Dim frmMainIndex As New FormMainIndex
frmMainIndex.Enabled = True
End Sub
的FormClosing所以當我調用添加產品表單時,我在主窗體中設置了enabled = false,當關閉我的添加產品窗體時enabled = true,但啓用= true將不起作用。
當我關閉我的添加產品時,它只隱藏添加產品表單但未啓用主表單,主表單仍未啓用。我的代碼有問題嗎?