public void GotoFirstLine() { AdvancedTextBox atb = fm.CurrentControl as AdvancedTextBox; if (atb != null && ((Control)atb).Focused) { atb.GotoFirstLine(); } }