在运行时设置DataGridView列的宽度 [英] Setting width of DataGridView columns at Run time

查看:445
本文介绍了在运行时设置DataGridView列的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

在程序中,我需要在运行时更改DataGridView的每列的宽度.您可以通过编写代码段让我知道吗?

非常感谢您

Hello,

In a program I need to change the width of each columns of DataGridView at run time. Could you please let me know by writing the code snippet?

Thank you very much

推荐答案

这非常困难-您确定要这样做吗?
It''s horribly difficult - are you sure you want to do this?
dataGridView1.Columns[0].Width = 50;
dataGridView1.Columns[1].Width = 150;


这篇关于在运行时设置DataGridView列的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆