|
 |
|
listview แบบ column จะเพิ่มข้อมูลซัพที่มีมากกว่า 1 อันได้ยังไงคับ |
|
 |
|
|
 |
 |
|
Code (C#)
private void PrepareListView()
{
//Clear ListView Column.
if (listView1.Columns.Count > 0)
listView1.Columns.Clear();
// Create columns for the items and subitems.
// Width of -2 indicates auto-size.
listView1.Columns.Add(string.Empty, 25, HorizontalAlignment.Left);
listView1.Columns.Add("Process", 150, HorizontalAlignment.Left);
listView1.Columns.Add("Status", 385, HorizontalAlignment.Left);
// Create two ImageList objects.
ImageList imageListSmall = new ImageList();
imageListSmall.ColorDepth = ColorDepth.Depth32Bit;
imageListSmall.ImageSize = new System.Drawing.Size(20, 20);
// Initialize the ImageList objects with bitmaps.
imageListSmall.Images.Add(global::ProjectName.Properties.Resources.Pending);
imageListSmall.Images.Add(global::ProjectName.Properties.Resources.Running);
imageListSmall.Images.Add(global::ProjectName.Properties.Resources.TrueSign);
imageListSmall.Images.Add(global::ProjectName.Properties.Resources.FalseSign);
//Assign the ImageList objects to the ListView.
listView1.SmallImageList = imageListSmall;
//Clear ListView Item.
if (listView1.Items.Count > 0)
listView1.Items.Clear();
string[] checkFileProcess = new string[] {
"Check SQL Server 2008",
"Check Excel Format",
"Check Header Row",
"Read Data"
};
foreach (string process in checkFileProcess)
{
ListViewItem item = new ListViewItem(string.Empty, 0);
item.SubItems.Add(process);
item.SubItems.Add(string.Empty);
listView1.Items.Add(item);
}
labelFileName.Text = string.Empty;
}
|
 |
 |
 |
 |
Date :
2012-12-24 14:29:38 |
By :
ห้ามตอบเกินวันละ 2 กระทู้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดูแล้วเหมือนจะ งงๆ
ข้างบนนี้มันมี code สร้างออฟเจ็คเองด้วยใช่ป่าวครับ
ขอ code vb ได้ไหมครับ จะได้ง่ายต่อการศึกษา code
ขอบคุณล่วงหน้าเลย
|
 |
 |
 |
 |
Date :
2012-12-24 14:51:47 |
By :
thon1900 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|