Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获取TextBox当前关注的 ID?如果没有焦点,它应该返回一个空值。
TextBox
注意:它应该只检查文本框。
TextBox focusedTxt = Controls.OfType<TextBox>().FirstOrDefault(x => x.Focused);