简体   繁体   English

如何在C#中设置表格宽度以自动调整为datagridview的宽度

[英]How to set width of form to auto adjust to width of datagridview in C#

I want to set the width of my form to automatically resize depending on width of the datagridview, case is in the picture: 我想将表单的宽度设置为根据datagridview的宽度自动调整大小,大小写在图片中:

So basically I want to remove horizontal scrollbar. 所以基本上我想删除水平滚动条。

像这样使用……。

DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill

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

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