如何在控制台应用程序中获取光标的位置? [英] How can I get the position of the cursor in a console app?
本文介绍了如何在控制台应用程序中获取光标的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望能够检查光标的位置是否没有移过某个点。我还没有找到任何可通过Google提供文本光标位置的东西。我不太确定其他地方。
I would like to be able to check that the position of the cursor hasn't moved past a certain point. I haven't been able to find anything that gives the position of the text cursor via google. I'm not really sure where else to look.
推荐答案
查看Console类的各种方法和属性。具体来说,使用Console.CursorLeft和Console.CursorTop,可以获得并设置光标的位置。
Look at the various methods and properties of the Console class. Specifically, using Console.CursorLeft and Console.CursorTop, you can get and set the position of the cursor.
这篇关于如何在控制台应用程序中获取光标的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文