|
查看: 1247|回复: 8
|
VB.net Listviewbox
[复制链接]
|
|
|
我有一个listbox,with 5 columns...我把listbox的资料都传去email 。。。。但是在mail里面的format有问题。。。
any1 can help me with formatting??
sample output:
Products Unit Price Quantity Discount Total
dwa222210435.6
it shud be like tis
Products Unit Price Quantity Discount Total
dwa 22 2 10 20 435.6
any ideas to make it like tis?
英文~~
帮下忙来。。。 |
|
|
|
|
|
|
|
|
|
|
发表于 2-10-2009 06:43 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 2-10-2009 08:38 PM
|
显示全部楼层
如果長短差很多的話..用stringbuilder來排列也可以, 當然..這只是其中1個方法
Dim buffer As New StringBuilder
Dim l1 As String = "{0,-20}{1,-20}{2,-20}" + vbCrLf
buffer.AppendFormat(l1, "Product", "Unit", "Price")
For Each line As ListViewItem In ListView1.Items
buffer.AppendFormat(l1, line.SubItems(0).Text, line.SubItems(1).Text, line.SubItems(2).Text)
Next
大概是這樣..write進notepad開起來看是整齊的
不過在form裡面看起來不怎麼整齊 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 2-10-2009 11:06 PM
|
显示全部楼层
|
谢谢!vbtab 我用过可是不能。。。我试下先。。。 |
|
|
|
|
|
|
|
|
|
|
发表于 3-10-2009 01:18 AM
|
显示全部楼层
原帖由 打不死小顽童~ 于 2-10-2009 11:06 PM 发表 
谢谢!vbtab 我用过可是不能。。。我试下先。。。
忘了說..要display出來時用buffer.toString() |
|
|
|
|
|
|
|
|
|
|
发表于 5-10-2009 11:25 AM
|
显示全部楼层
|
将你要 send 的 content 换成 HTML 也可以 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-10-2009 01:48 PM
|
显示全部楼层
|
对!!我看到资料也说html会好点。。。因为我是要send去mail的。。。可是我对html不太熟系。。。。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 5-10-2009 02:01 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 5-10-2009 04:46 PM
|
显示全部楼层
原帖由 打不死小顽童~ 于 5-10-2009 02:01 PM 发表 
可是我要弄去mail。。。。
不太熟html沒關係
只需要懂用html的<table>就好
去google找table的tr, td怎麼用..
再用for loop.. |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|