Column divided Box ?

You can put both strings in the dropdown, such as:
Team 1 (Dan Jones)
Team 2 (Bob Jones)

or

Team 1, Dan Jones coach
Team 1, Bob Jones coach

or something similar.

There are many 3rd party controls that support multiple columns in a dropdown. If you want some, search google and I'm sure you can find some that include source (just a guess) and/or are free.

-nerseus
 
Is there still a listview control in .NET? I remember doing a:
Visual Basic:
lvwMain.ColumnHeaders.Add , , "Team", 4000
in VB 6. Can I still do something like that?
 
There is still a ListView, yes. If you want a multi-column list you can also use a ListBox which supports multiple columns using a tab stop.

-ner
 
How do I specify each column? I can create each column, but how do I say I want this in the second coloumn and this in the third and so on?
 
Last edited:
For the listview? You use the SubItems collection of each ListViewItem object to add things to the other columns.
 
Here's a sample to set tabstops in a standard Listbox.

C#:
// Declare the SendMessage API to set the tab stops
// You can put this at the top of a form
private const int LB_SETTABSTOPS = 0x192;
[DllImport("user32", EntryPoint="SendMessage")]
		private static extern int SendMessageTabStops(int handle, int msg, int tabCount, int[] tabStops);

// ... in Form_Load:
int[] tabStops = new int[] {0, 50, 100};
listBox1.Items.Add("dan\tjones\tMe");
listBox1.Items.Add("bob\tjones\tHim");
listBox1.Items.Add("hagatha\tjones\tHer");
SendMessageTabStops(listBox1.Handle.ToInt32(), LB_SETTABSTOPS, tabStops.Length, tabStops);

The above creates three tabstops. One at 0 pixels (left aligned), one at 50 pixels and one at 100 pixels. You can create as many as you want. If you don't know C# syntax, let me know and I can convert to VB.NET (maybe). Not sure how to do a tab character in VB.NET, maybe it's still vbTab? Wishful thinking... :)

-Nerseus
 
Back
Top