如何让checkedlistbox中的栏宽度适应字符串长度? checkedListBox设置为多栏,但是栏目宽度都是一致的,但是我希望每个栏自适应宽度,根据此栏的最大字符串自适应。有这个可能吗?如何设置? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int pp = 0; for (int i = 0; i < this.checkedListBox1.Items.Count; i++) { if (this.checkedListBox1.Items[i].ToString().Length > pp) { pp = this.checkedListBox1.Items[i].ToString().Length; } } //pp是此栏的最大字符串长度. this.checkedListBox1.Width = (int)this.checkedListBox1.Font.SizeInPoints * pp; 求教,关于多个页面验证用户登录弹出框制作 c# 写windows服务,怎么调试? 请教一个SQL语句 .net中相当棘手的一个问题 C#表格问题,希望大家帮帮忙,等有分了,定补上! 用html help workshop作了一个chm格式的帮助文档,不知道怎么显示出来 请问我用OLE方式连接EXCEL表,遍历SHEET名称,为何出来很多不同的东西呢?(急) 怎么连接MSDE,安装了MSDE后连接不上。 C#程序编译出现错误.. c#中如何播放视音频文件? 怎么理解.net里的页面布局 求Wrox Beginning Visual C Sharp 2005中文版
for (int i = 0; i < this.checkedListBox1.Items.Count; i++)
{
if (this.checkedListBox1.Items[i].ToString().Length > pp)
{
pp = this.checkedListBox1.Items[i].ToString().Length;
} } //pp是此栏的最大字符串长度. this.checkedListBox1.Width = (int)this.checkedListBox1.Font.SizeInPoints * pp;