private void getSelectionStart() { if (this.InvokeRequired) { // this is worker thread getSelectionStartDelegat del = new getSelectionStartDelegat(getSelectionStart); this.Invoke(del); } else { // this is UI thread sartPos = this.SelectionStart; } }