An NDoc Documented Class Library |

# FTPConnection.UseGuiThreadIfAvailable Property

Determines whether or not event-handlers will be run on the GUI thread if one is available.

public bool UseGuiThreadIfAvailable {get; set;}

#### Property Value

The `UseGuiThreadIfAvailable` flag determines whether or not event-handlers will be run on the GUI thread if one is available. If the flag is `true` (the default) then they will be run on the GUI thread if one is available (only for Windows Forms applications). If the flag is `false` then they will be run on a worker-thread.

#### Remarks

It is important to note that if event-handlers are run on a worker-thread then Windows Forms related operations will usually fail. Since such operations are commonly used in event-handlers, the default is `true`.

#### See Also

FTPConnection Class | EnterpriseDT.Net.Ftp Namespace