Click here to Skip to main content
15,902,114 members
Home / Discussions / C#
   

C#

 
GeneralHowto make TreeView with custom expand/collapse images?. Pin
kobalcz20-Nov-02 5:24
kobalcz20-Nov-02 5:24 
GeneralC#1: Naming controls in designer Pin
peterchen20-Nov-02 2:31
peterchen20-Nov-02 2:31 
GeneralRe: C#1: Naming controls in designer Pin
Shaun Wilde20-Nov-02 2:39
Shaun Wilde20-Nov-02 2:39 
GeneralRe: C#1: Naming controls in designer Pin
peterchen20-Nov-02 2:43
peterchen20-Nov-02 2:43 
GeneralRe: C#1: Naming controls in designer Pin
Shaun Wilde20-Nov-02 2:56
Shaun Wilde20-Nov-02 2:56 
QuestionHow Can I develop Plug-im for MSN Messenger Pin
to_ik_khan19-Nov-02 20:04
to_ik_khan19-Nov-02 20:04 
AnswerRe: How Can I develop Plug-im for MSN Messenger Pin
Ryan Cromwell20-Nov-02 4:19
Ryan Cromwell20-Nov-02 4:19 
GeneralRemoting Examples Pin
Vasudevan Deepak Kumar19-Nov-02 19:23
Vasudevan Deepak Kumar19-Nov-02 19:23 
GeneralRe: Remoting Examples Pin
Joshua Nussbaum19-Nov-02 20:45
Joshua Nussbaum19-Nov-02 20:45 
GeneralRe: Remoting Examples Pin
SimonS19-Nov-02 21:27
SimonS19-Nov-02 21:27 
GeneralMulti-Column Listbox :: C# Pin
valikac19-Nov-02 17:08
valikac19-Nov-02 17:08 
GeneralRe: Multi-Column Listbox :: C# Pin
Joshua Nussbaum19-Nov-02 20:56
Joshua Nussbaum19-Nov-02 20:56 
GeneralRe: Multi-Column Listbox :: C# Pin
valikac20-Nov-02 12:07
valikac20-Nov-02 12:07 
GeneralRe: Multi-Column Listbox :: C# Pin
Joshua Nussbaum20-Nov-02 12:46
Joshua Nussbaum20-Nov-02 12:46 
Use the ListView.Columns.Add(..) method, see example below

using System;
using System.Windows.Forms;


public class ListViewForm : Form {
public static void Main() {
Application.Run(new ListViewForm());
}


// test data
public readonly string[] firstNames = {"John","James","Leroy","Jane","Elizabeth","Samantha"};
public readonly string[] lastNames = {"Johnson","Smith","Doe","Gainsworth","Hadley","Buckley"};

private ListView listView;

public ListViewForm() {
listView = new ListView();
listView.Dock = DockStyle.Fill;
listView.View = View.Details;
listView.Columns.Add("Last", -2, HorizontalAlignment.Left);
listView.Columns.Add("First", -2, HorizontalAlignment.Left);

// load the data
int f, l;
ListViewItem lvi;

// create a cross product of the names
for (f=0;f<firstNames.Length;f++) {
for (l=0;l<lastNames.Length;l++) {
lvi = new ListViewItem();
lvi.Text = lastNames[l];
lvi.SubItems.Add(firstNames[f]);

// add the item
listView.Items.Add(lvi);
}
}


this.Controls.Add(listView);
}
}
GeneralRe: Multi-Column Listbox :: C# Pin
valikac20-Nov-02 15:10
valikac20-Nov-02 15:10 
GeneralRe: Multi-Column Listbox :: C# Pin
David Stone20-Nov-02 17:48
sitebuilderDavid Stone20-Nov-02 17:48 
GeneralRe: Multi-Column Listbox :: C# Pin
valikac20-Nov-02 17:51
valikac20-Nov-02 17:51 
GeneralRe: Multi-Column Listbox :: C# Pin
LongRange.Shooter21-Nov-02 9:56
LongRange.Shooter21-Nov-02 9:56 
GeneralRe: Multi-Column Listbox :: C# Pin
valikac21-Nov-02 9:59
valikac21-Nov-02 9:59 
GeneralRe: Multi-Column Listbox :: C# Pin
ian mariano20-Nov-02 3:05
ian mariano20-Nov-02 3:05 
Questioni have two threads and make a group of it? Pin
imran_rafique19-Nov-02 16:31
imran_rafique19-Nov-02 16:31 
AnswerRe: i have two threads and make a group of it? Pin
Joshua Nussbaum19-Nov-02 20:57
Joshua Nussbaum19-Nov-02 20:57 
Questionwhy use property in class? Pin
zhoujun19-Nov-02 14:40
zhoujun19-Nov-02 14:40 
AnswerRe: why use property in class? Pin
Christian Graus19-Nov-02 19:43
protectorChristian Graus19-Nov-02 19:43 
AnswerRe: why use property in class? Pin
ian mariano20-Nov-02 2:52
ian mariano20-Nov-02 2:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.