sjchin Posted March 24, 2003 Posted March 24, 2003 Hi guys, may i know any way make the combo in VB.Net contain multicolumns when user click on drop down? Is there any OCX or components can do it in VB.NET? Quote
Leaders dynamic_sysop Posted March 24, 2003 Leaders Posted March 24, 2003 you mean so that there's text with another column next to it, or so that there's a drop down list of text? eg: text1 | text2 text3 | text4 or: text1 text2 text3 text4 because for the drop down list i know thats a case of setting the combobox's properties to "dropdownlist", then when you do something like.... ComboBox1.Items.Add(TextBox1.Text)'Add to combobox the list gets longer as you add the text to it. Quote
sjchin Posted March 24, 2003 Author Posted March 24, 2003 my problem is the click on combo drop down, instead appear 1 columns, i want 2 or 3 columns. Example : Text1 Text 2 Test 3 Not Text1 Text2 Text3 Beside this, as i know in VB.net contain Combo Version 2, may i know how to used it? Thanks Quote
*Experts* Nerseus Posted March 24, 2003 *Experts* Posted March 24, 2003 I've never seen this feature in a ComboBox, but that doesn't mean it doesn't exist. I do know you can do this in a ListBox. Here's some VB6 code that works by setting the TabStops. I tried this on a ComboBox with no luck, but maybe it will spark something... Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const LB_SETTABSTOPS As Long = &H192 Private Sub Form_Load() Dim Tabs(2) As Long Tabs(0) = 0 Tabs(1) = 50 Tabs(2) = 150 SendMessage List1.hwnd, LB_SETTABSTOPS, CLng(UBound(Tabs)) + 1, Tabs(0) List1.AddItem "hello" & vbTab & "world" & vbTab & "dan" List1.AddItem "hello" & vbTab & "world" & vbTab & "dan" List1.AddItem "hello" & vbTab & "world" & vbTab & "dan" End Sub Note that the tabstop numbers (0, 50, 150) are always in Pixels (as far as I can tell). -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
Negative0 Posted March 25, 2003 Posted March 25, 2003 If you want you can use the Microsoft Forms 2.0 ComboBox. This type of combo box is similar to the one in Access that lets you have multiple columns. Quote
*Gurus* divil Posted March 26, 2003 *Gurus* Posted March 26, 2003 No, you should not use the Forms 2.0 combobox. You are not allowed to distribute those controls with any application. 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
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.