FMECA
是一个类,它的成员m_fmecaWin
为winforms。
在特定的子例程中,我有一个FMECA
类的对象,我需要访问m_fmecaWin
的系统事件。
Private Sub initialiseFMECATableFromLoad(ByVal fmeca As GraphFMECA, ByVal detTable As DataTable)
fmeca.m_fmecaWin.chkListBox.AllowGrayed = False
' need to mark e As System.Windows.Forms.FormClosingEventArgs; e.Cancel = True ' to be reviewed later
If fmeca.m_fmecaWin.chkListBox.Items.Count <> 0 Then Exit Sub
For Each col As GridColumn In fmeca.m_fmecaWin.GridView1.Columns
fmeca.m_fmecaWin.chkListBox.Items.Add(col.FieldName, col.Caption, CheckState.Checked, True)
Next
End Sub
您认为可以在上面的子例程中访问m_fmeca
FormClosingEventArgs
吗?
谢谢。
答案 0 :(得分:0)
你能在日常工作中处理结束事件吗?
AddHandler fmeca.m_fmecaWin.FormClosing, Sub (sender As Object, e As System.Windows.Forms.FormClosingEventArgs) e.Cancel = True
我的VB Lambdas可能有点生疏......但我认为语法是正确的......