简体   繁体   English

单击一下console.writeline

[英]console.writeline with a click

Could somebody tell me how I can make a text that the player can click so a Console.WriteLine will be executed? 有人可以告诉我如何制作播放器可以单击的文本,以便执行Console.WriteLine吗?

I'm using Console application in C#. 我在C#中使用控制台应用程序。

You can't capture mouse events in a console application (without low-level windows API hooks), so you can't do this. 您无法在控制台应用程序中捕获鼠标事件(没有低级的Windows API挂钩),因此无法执行此操作。

My suggestion is to make it a WinForms or WPF application, and include a textbox which is your console window. 我的建议是使其成为WinForms或WPF应用程序,并包括一个文本框,它是您的控制台窗口。

Maybe take a look at ShellControl . 也许看看ShellControl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM