Note that TIdTCPServer is a multi-threaded component. Its OnConnect, OnDisconnect, OnExecute, and OnException events are triggered in the context of worker threads, not in the context of the main UI thread. As such, you MUST sync with the main UI thread in order to safely access UI controls from within those events. You can use Indy's TIdSync or TIdNotify classes in the IdSync unit, or the RTL's TThread.Synchronize() or TThread.Queue() methods in the Classes unit. Or any other inter-thread mechanism you want to use to delegate code execution to the main UI thread (window/thread messages, thread-safe queues, etc).