应用程序的监视器/屏幕更改事件?
我的 WPF 应用程序中有一个 DataGrid。我正在设置 DataGrid 相对于应用程序当前所在屏幕分辨率的最大宽度。
当用户在主监视器上启动应用程序时,我的解决方案工作正常,但当用户将应用程序拖动到第二个监视器时就会出现问题监视器。我需要一个事件来告诉我应用程序何时移动到新监视器,以便我可以根据当前监视器的分辨率重置 DataGrid 的最大宽度。我怎样才能做到这一点?
I have a DataGrid
in my WPF application. I am setting DataGrid
's maximum width relative to resolution of screen in which application currently resides in.
My solution works fine when user launches the application on primary monitor but the problem comes when user drags the application to second monitor. I need an event which can tell me when the application is moved to a new monitor so that I can reset the DataGrid
's maximum width according to current monitor's resolution. How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过 LocationChanged 事件?
Did you try the LocationChanged event?