有没有人知道“如何向列表视图添加多个文本框和组合框" [英] Is there any one know "How To Add Multiple Textbox and compobox to a Listview

查看:52
本文介绍了有没有人知道“如何向列表视图添加多个文本框和组合框"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,请帮我解决这个问题.....

我要创建一个计费软件.在销售表单上,我需要创建一个列表视图,在列表视图中,我需要添加文本框以添加项目详细信息....所以请帮助我.......

Hello please help me to solve this problem.....

I am going to create a billing software.At the sales form i need to create a listview and within the listview i need to add textboxes to add item details....So plz help me.......

推荐答案

您是说要创建类似excel的东西?并用单元格创建列?

如果是这样,则将一个列表视图添加到您的设计器中,转到属性"->视图"并将其设置为详细信息".然后转到列以添加新列.

这是一篇文章,可以帮助您:http://msdn.microsoft.com/zh-cn/library/system.windows.forms.listview.aspx
Do you mean to create something like excel? And create column with cells?

If so, add a listview to your designer, go to Properties->View and set it to "Details". Then go to columns to add new columns.

Here is a article to help: http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.aspx



(点击查看大图)

你的意思是那样吗?如果是这样,那么我上面提供的MSDN文章就足够了.只需查看提供的示例代码即可.通过代码添加项目,它显示了列表视图的所有内容.

尝试将列表视图拖到您的设计器上,然后放入代码(来自ListView MSDN文章:http://msdn.microsoft.com/zh-cn/library/system.windows.forms.listview.aspx)

(Click to enlarge)

Do you mean something like that? If so, then the MSDN article I provided above is sufficient. Just look at the example code provided. It shows you all the ins and outs of the list view by adding items through the code.

Try dragging a list view onto your designer and put in the code (from the ListView MSDN Article: http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.aspx)
// Create three items and three sets of subitems for each item.
			ListViewItem item1 = new ListViewItem("item1",0);
			// Place a check mark next to the item.
			item1.Checked = true;
			item1.SubItems.Add("1");
			item1.SubItems.Add("2");
			item1.SubItems.Add("3");
			ListViewItem item2 = new ListViewItem("item2",1);
			item2.SubItems.Add("4");
			item2.SubItems.Add("5");
			item2.SubItems.Add("6");
			ListViewItem item3 = new ListViewItem("item3",0);
			// Place a check mark next to the item.
			item3.Checked = true;
			item3.SubItems.Add("7");
			item3.SubItems.Add("8");
			item3.SubItems.Add("9");

			// Create columns for the items and subitems.
			// Width of -2 indicates auto-size.
			listView1.Columns.Add("Item Column", -2, HorizontalAlignment.Left);
			listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);
			listView1.Columns.Add("Column 3", -2, HorizontalAlignment.Left);
			listView1.Columns.Add("Column 4", -2, HorizontalAlignment.Center);

			//Add the items to the ListView.
            		listView1.Items.AddRange(new ListViewItem[]{item1,item2,item3});


那又怎样?这样做有问题....?
只需将LIST VIEW拖到您的窗体中,然后将控件拖到窗体上即可....
有可能只是通过它.
Shweta:rose:
So What a problem in doing this....?
Just Drag the LIST VIEW in to your form and then drag the controls over it....
It is possible just go through it.
Shweta:rose:


这篇关于有没有人知道“如何向列表视图添加多个文本框和组合框"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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