WPF Hide on Close?

Posted by Petoj on Stack Overflow See other posts from Stack Overflow or by Petoj
Published on 2009-03-12T14:43:15Z Indexed on 2010/04/15 5:33 UTC
Read the original article Hit count: 331

Filed under:
|
|

How do i do this in wpf

VB.NET

   Private Sub FrmSettings_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        e.Cancel = (e.CloseReason = Forms.CloseReason.UserClosing)
        Me.Hide()
    End Sub

c#

private void FrmSettings_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
{
    e.Cancel = (e.CloseReason == Forms.CloseReason.UserClosing);
    this.Hide();
}

as wpf's Close event just gives me e.Cancel and no closereason :(

© Stack Overflow or respective owner

Related posts about wpf

Related posts about vb.net