问题描述
大家好,
我的表格中有datagridview,里面有SQL列,我用这段代码设置宽度的那些列:
dataGridView1.Columns [name ]。宽度= 353;
问题是,当我运行此程序时,当我最大化窗体大小时,这些列不会自动调整宽度(同时datagridview会自动调整大小和填充整个表单,因为我设置了ANCHOR,但列的宽度与之前相同)。
有没有办法设置这些列最小宽度和自动调整大小它们取决于表格的大小?
提前谢谢
Hello guys,
I have datagridview in my form which has SQL columns inside, to those columns I set width with this code:
dataGridView1.Columns["name"].Width = 353;
Problém is that those columns doesnt automatically resize width when I maximize size of form when i run this program(also datagridview automatically resizes and fills the whole form because i set ANCHOR to it, but columns has the same width as before).
Is there any way to set to those columns min width and auto resize them depending to the size of form?
Thanks in advance
这篇关于c#列自动宽度取决于表单分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!