Procedure untuk mengambil karakter dari kiri,kanan atau tengah
public static string Kiri(string param, int length) //fungsi untuk mengambil
//karakter dari sebelah kiri
{
string result = param.Substring(0,length);
return result;
}
public static string Kanan(string param, int length) //fungsi untuk mengambil
//karakter dari sebelah kanan
{
string result = param.Substring(param.Length - length, length);
return result;
}
public static string tengah(string param,int start, int length) //fungsi untuk mengambil
//karakter dari sebelah kiri
{
string result = param.Substring(start, length);
return result;
}
Rabu, 30 Juni 2010
Procedure untuk mengambil karakter dari kiri,kanan atau tengah pada c#
ListViewItem Collection Editor

When you select the first item on the ListView Tasks menu, the ListViewItem Collection Editor is displayed. This editor can also be accessed by clicking on the button in the right hand column of the Items property in the Properties Window.
Once the editor is open, ListViewItems can be added or removed, and their properties can be set. A ListViewItem object can display an image along with text. An ImageList must be used to associate an image with a ListViewItem object.
The ListViewItem class represents items in a ListView control and the ListViewSubItem class represents a sub-item related to a ListViewItem. The ListViewItem class exposes the SubItems collection property that represents the list of sub-items related to an item. The number of sub-items should equal the number of columns minus one.
This editor can also be accessed by clicking on the button in the right hand column of the SubItems property in the ListViewItem Collection Editor.
Adding items manually
Items can be added manually by adding ListViewItems to the ListView's Items collection property. The following code demonstrates how to add items to a ListView control:
ListViewItem listViewItem1 = new ListViewItem();
ListViewSubItem listViewSubItem1 = new ListViewSubItem();
listViewItem1.Text = "Joe";
listViewSubItem1.Text = "123 Somewhere Street";
listViewItem1.SubItems.Add(listViewSubItem1);
listView1.Items.Add(listViewItem1);
source : http://en.csharp-online.net/ListView