Prevent Form close

  • Thread starter Thread starter sennopati
  • Start date Start date
S

sennopati

Dear,
I have looping statement like this:

For Each frmChild As Form In Me.MdiChildren
'Ada validasi untuk periksa status data(sudah disimpan
atau belum)
frmChild.Close()
frmChild = Nothing
Next

in each form child (frmchild), I added validation in event frmclosing,
if data modified form child will raise messagebox to inform user
what action will taken by user?? (save, Not save, or cancel closing
all Mdichild form).

The Problem is I cannot catch return value from function
"frmchild.close()" if user take action cancel closing all mdichild
form. HOw tho solve this problem?

Many thx

Sennopati
 
sennopati said:
Dear,
I have looping statement like this:

For Each frmChild As Form In Me.MdiChildren
'Ada validasi untuk periksa status data(sudah disimpan
atau belum)
frmChild.Close()
frmChild = Nothing
Next

in each form child (frmchild), I added validation in event
frmclosing, if data modified form child will raise messagebox to
inform user what action will taken by user?? (save, Not save, or
cancel closing all Mdichild form).

The Problem is I cannot catch return value from function
"frmchild.close()" if user take action cancel closing all mdichild
form. HOw tho solve this problem?

frmChild.Close()
if frmChild.IsHandleCreated then
msgbox "Child not closed"
end if


Armin
 
Back
Top