Determine if Form is currently closing
10:24 23 Dec 2025

When closing my form, an event from a third-party control (UltraGanttView by Infragistics) is firing once more before closing the dialog. Inside the event I would like to check if the form is currently performing closing or not. If so, I want to simply return and don't do the standard procedures I am executing inside the event normally. I found out that there is a property called IsClosing inside the Form class but unfortunately it is private. Is there any chance I can access the IsClosing state of the form at any point or can I retrieve it somewhere else?

Other approaches would be setting a custom flag inside the FormClosing event or disable the event before closing.

Are there any other chances? Or is this maybe a malfunctioned implementation of the custom control?


private void foo() 
{
   this.Close() // fires gantt_TimelineVisibleDateTimeRangeChanged
}

private void gantt_TimelineVisibleDateTimeRangeChanged(object sender, VisibleDateTimeRangeChangedEventArgs e)
{
    // do some visual and logic stuff
    if (this.IsClosing) // private
       return;
}
c# .net winforms infragistics