• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# Help
#1
Like in VB6 how you can have Form_Unload or something, how do you control the events when the form closes?
  Reply
#2
FormClosing (Happens before the form is closed)

and

FormClosed (Happens after the form is closed)

Code:
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

    End Sub

Code:
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed

    End Sub
  Reply
#3
Ok so in C# it would be

Code:
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    // My code
}
  Reply
#4
<!-- m --><a class="postlink" href="http://www.java2s.com/Code/CSharp/GUI-Windows-Form/Formwindowclosingevent.htm">http://www.java2s.com/Code/CSharp/GUI-W ... gevent.htm</a><!-- m -->
[Image: aguserbar3.png]
GIAKEN Wrote:Since I'm into men, not women
GIAKEN Wrote:I can't take these huge penises anymore! All that's left is shame! And blood
  Reply
#5
Sorry forgot you wanted C# =P
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)