用vs2010操作c#修改数据库在listview中怎样做?
2015-11-24
展开全部
//拖动一个listView1到窗体上
private void Form1_Load(object sender, EventArgs e)
{
listView1.View = View.Details;
listView1.Dock = DockStyle.Fill;
listView1.Columns.Add("col1");
listView1.Columns.Add("col2");
listView1.Columns.Add("col3");
}
//在属性窗口双击产生事件代码
private void listView1_SizeChanged(object sender, EventArgs e)
{
int w = (listView1.Width-10) / 3;//减10是考虑到边框和滚动条的宽度
listView1.Columns[0].Width = w;
listView1.Columns[1].Width = w;
listView1.Columns[2].Width = w;
}
private void Form1_Load(object sender, EventArgs e)
{
listView1.View = View.Details;
listView1.Dock = DockStyle.Fill;
listView1.Columns.Add("col1");
listView1.Columns.Add("col2");
listView1.Columns.Add("col3");
}
//在属性窗口双击产生事件代码
private void listView1_SizeChanged(object sender, EventArgs e)
{
int w = (listView1.Width-10) / 3;//减10是考虑到边框和滚动条的宽度
listView1.Columns[0].Width = w;
listView1.Columns[1].Width = w;
listView1.Columns[2].Width = w;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询