private void Form_Resize(object sender, WndEventArgs e) { // code to execute when the form is being resized }
private void Form_Close(object sender, WndEventArgs e) { // code to execute when the form is being closed }In both examples, the event parameter (e) is of type WndEventArgs which provides information about the event being handled. This allows us to perform specific actions based on the type of event that occurred. The package library used in both examples is System.Windows.Forms.