我在datagridview中有一个复选框,该复选框未呈现/可见,并且可以在某些远程桌面会话中与之进行交互 - 我如何修复它?
环境
RDP目标:Windows 2016 Hyper-V服务器
RDP客户端:Windows 10
客户端监视器:1920x1080 150%缩放。
应用
C ++/MFC带有产卵(通过COM)C#Winform,显示具有许多控件的数据网格视图,包括单元格中的复选框。
C#.NET 4.6/4.7
问题
复选框在显示时根本不会呈现。如果RDP目标是本地Hyper-V中的Windows 10客户端,则不会发生。
使用任何监视器作为RDP会话主机,而不是100%或125%的主机出现问题。 问题以任何分辨率发生。
进行解决方法
- 使用具有100%缩放的监视器或缩放率125%的监视器
- 。在目标服务器内部,将应用程序设置为在兼容模式下使用8位颜色
Environment
RDP Target: Windows 2016 Hyper-V Server
RDP Client: Windows 10
Main Monitor of client: 1920x1080 150% scaling.
Application
C++/MFC with spawned (via COM) C# Winform, showing a Data Grid View with a number of controls, including checkboxes in cells.
C# .NET 4.6/4.7
Problem
The Checkbox does not render at all when shown. Does not happen if the RDP target is a Windows 10 client in a local Hyper-V.
Using any monitor as the RDP session host which is not 100% or 125% exhibits the problem.
Problem happens at any resolution.
Workarounds
- Using a monitor with 100% scaling, or 125% scaling.
- Inside the target server, set the application to use 8bit colour in compatibility mode
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是行高度固定而太小。复选框无法绘制。
以下代码解决了它。
grid.autosizerowsmode = System.Windows.Forms.DatagridViewAutoSizerOwsMode.disPlayedCells;
The problem was that the row height was fixed, and too small. The checkbox was unable to draw.
The following line of code solved it.
grid.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells;