tehon3299 Posted March 26, 2003 Posted March 26, 2003 What should I use if I want to have a box with divided columns on a form? i.e. I want a column for Team Name, and Coach. What should I use? Quote Thanks, Tehon
*Experts* Nerseus Posted March 26, 2003 *Experts* Posted March 26, 2003 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 Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
tehon3299 Posted March 26, 2003 Author Posted March 26, 2003 Is there still a listview control in .NET? I remember doing a: lvwMain.ColumnHeaders.Add , , "Team", 4000 in VB 6. Can I still do something like that? Quote Thanks, Tehon
*Experts* Nerseus Posted March 26, 2003 *Experts* Posted March 26, 2003 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 Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
tehon3299 Posted March 26, 2003 Author Posted March 26, 2003 (edited) 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? Edited March 26, 2003 by tehon3299 Quote Thanks, Tehon
*Gurus* divil Posted March 27, 2003 *Gurus* Posted March 27, 2003 For the listview? You use the SubItems collection of each ListViewItem object to add things to the other columns. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* Nerseus Posted March 27, 2003 *Experts* Posted March 27, 2003 Here's a sample to set tabstops in a standard Listbox. // 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 Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.